-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintcache
More file actions
1 lines (1 loc) · 9.86 KB
/
.eslintcache
File metadata and controls
1 lines (1 loc) · 9.86 KB
1
[{"/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/index.js":"1","/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingVisualization.js":"2","/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgos/MergeSort.js":"3","/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/reportWebVitals.js":"4","/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgos/mergeSort.js":"5","/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/App.js":"6","/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgoAnimations/insertionSort.js":"7","/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgoAnimations/mergeSort.js":"8","/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgoAnimations/selectionSort.js":"9","/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgoAnimations/bubbleSort.js":"10"},{"size":500,"mtime":1606900969953,"results":"11","hashOfConfig":"12"},{"size":8095,"mtime":1617564855300,"results":"13","hashOfConfig":"12"},{"size":83,"mtime":1606947394273,"results":"14","hashOfConfig":"12"},{"size":362,"mtime":1606900969960,"results":"15","hashOfConfig":"12"},{"size":667,"mtime":1607039065042,"results":"16","hashOfConfig":"12"},{"size":235,"mtime":1606937256693,"results":"17","hashOfConfig":"12"},{"size":462,"mtime":1607016921878,"results":"18","hashOfConfig":"12"},{"size":4435,"mtime":1616778367080,"results":"19","hashOfConfig":"12"},{"size":928,"mtime":1616781203459,"results":"20","hashOfConfig":"12"},{"size":721,"mtime":1616786777092,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"1f92q8z",{"filePath":"25","messages":"26","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"27","messages":"28","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"31"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"36","usedDeprecatedRules":"37"},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"40"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"43","usedDeprecatedRules":"44"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"44"},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"37"},"/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/index.js",[],["49","50"],"/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingVisualization.js",["51","52"],"/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgos/MergeSort.js",["53"],"/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/reportWebVitals.js",[],["54","55"],"/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgos/mergeSort.js",[],"/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/App.js",["56"],"import logo from './logo.svg';\nimport './App.css';\nimport SortingVisualization from './SortingVisualization';\n\nfunction App() {\n return (\n <div className=\"App\">\n <SortingVisualization />\n </div>\n );\n}\n\nexport default App;\n",["57","58"],"/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgoAnimations/insertionSort.js",[],["59","60"],"/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgoAnimations/mergeSort.js",["61"],"export async function mergeSortHelper(array) {\n let arrayWithIndex = []\n await array.map((value, index) => {\n return arrayWithIndex.push({\n index: index, \n value: value, \n originalIndex: index})\n })\n console.log(arrayWithIndex)\n return await mergeSort(arrayWithIndex)\n}\nexport function mergeSort(array, animationArray = []) {\n if (array.length <= 1) \n return [array]\n const middleIndex = Math.floor(array.length / 2)\n const [left,] = mergeSort(array.slice(0, middleIndex), animationArray);\n const [right,] = mergeSort(array.slice(middleIndex), animationArray);\n const sortedArray = [];\n let i = 0,\n j = 0\n while (i < left.length && j < right.length) {\n if (left[i].value < right[j].value) {\n console.log(left[i])\n console.log(right[j])\n animationArray.push({\n leftIndex:left[i].index, \n rightIndex:right[j].index, \n leftValue:left[i].value, \n rightValue:right[j].value, \n move:'left' })\n // let tmp = right[j].index\n // right[j].index = left[i].index\n // left[i].index = tmp\n // console.log('left ',left[i])\n sortedArray.push(left[i++])\n } else {\n let indexCounter = i\n console.log('right j '+ j)\n animationArray.push({\n leftIndex:left[i].index, \n rightIndex:right[j].index, \n leftValue:left[i].value, \n rightValue:right[j].value, \n move:'right' })\n console.log(right[j])\n console.log(left[i])\n //swapping two columns does not work \n // let tmp = right[j].index\n // right[j].index = left[i].index\n // left[i].index = tmp\n // console.log('right ' , right[j])\n sortedArray.push(right[j++])\n }\n }\n //one term left\n while (i < left.length) {\n // animationArray.push({\n // leftIndex:left[i].index, \n // leftValue:left[i].value, \n // move:'last-left'})\n // console.log('las left ' , left[i])\n sortedArray.push(left[i++])\n }\n while (j < right.length) {\n // animationArray.push({\n // rightIndex:right[j].index, \n // rightValue:right[j].value, \n // move:'last-right'})\n // console.log('last right' , right[j])\n sortedArray.push(right[j++])\n }\n // console.log(sortedArray)\n return [sortedArray, animationArray]\n}\n\n\n\n// handleMergeSort = async function(){\n// const [sortedArray,animations] = await mergeSortHelper(this.state.array);\n// console.log(sortedArray)\n// const arrayBars = document.getElementsByClassName('array-bar');\n// animations.forEach((obj, index) => {\n// // console.log(obj)\n// setTimeout(() => {\n// if(obj.move === 'last-right'){\n// const rightBarStyle = arrayBars[obj.rightIndex].style;\n// rightBarStyle.backgroundColor = 'red';\n// setTimeout(() => {\n// rightBarStyle.backgroundColor = '#4169E1';\n// }, 200);\n// } else if (obj.move === 'last-left'){\n// const leftBarStyle = arrayBars[obj.leftIndex].style;\n// leftBarStyle.backgroundColor = 'red';\n// setTimeout(() => {\n// leftBarStyle.backgroundColor = '#4169E1';\n// }, 200);\n// } else{\n// const leftBarStyle = arrayBars[obj.leftIndex].style;\n// const rightBarStyle = arrayBars[obj.rightIndex].style;\n// leftBarStyle.backgroundColor = 'red';\n// rightBarStyle.backgroundColor = 'red';\n// if(obj.move === 'right'){\n// const leftBarNewHeight = obj.rightValue;\n// const rightBarNewHeight = obj.leftValue;\n// leftBarStyle.height = `${leftBarNewHeight}px`;\n// rightBarStyle.height = `${rightBarNewHeight}px`;\n// }\n// setTimeout(() => {\n// leftBarStyle.backgroundColor = '#4169E1';\n// rightBarStyle.backgroundColor = '#4169E1';\n// }, 200);\n// }\n// }, index * 250);\n// })\n// }",["62","63"],"/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgoAnimations/selectionSort.js",[],"/Users/Abhinav/Documents/GitHub/sorting-algorithms/src/SortingAlgoAnimations/bubbleSort.js",[],{"ruleId":"64","replacedBy":"65"},{"ruleId":"66","replacedBy":"67"},{"ruleId":"68","severity":1,"message":"69","line":6,"column":9,"nodeType":"70","messageId":"71","endLine":6,"endColumn":24},{"ruleId":"68","severity":1,"message":"72","line":47,"column":23,"nodeType":"70","messageId":"71","endLine":47,"endColumn":35},{"ruleId":"68","severity":1,"message":"73","line":2,"column":9,"nodeType":"70","messageId":"71","endLine":2,"endColumn":19},{"ruleId":"64","replacedBy":"74"},{"ruleId":"66","replacedBy":"75"},{"ruleId":"68","severity":1,"message":"76","line":1,"column":8,"nodeType":"70","messageId":"71","endLine":1,"endColumn":12},{"ruleId":"64","replacedBy":"77"},{"ruleId":"66","replacedBy":"78"},{"ruleId":"64","replacedBy":"79"},{"ruleId":"66","replacedBy":"80"},{"ruleId":"68","severity":1,"message":"81","line":37,"column":17,"nodeType":"70","messageId":"71","endLine":37,"endColumn":29},{"ruleId":"64","replacedBy":"82"},{"ruleId":"66","replacedBy":"83"},"no-native-reassign",["84"],"no-negated-in-lhs",["85"],"no-unused-vars","'mergeSortHelper' is defined but never used.","Identifier","unusedVar","'predBarStyle' is assigned a value but never used.","'animations' is assigned a value but never used.",["84"],["85"],"'logo' is defined but never used.",["84"],["85"],["84"],["85"],"'indexCounter' is assigned a value but never used.",["84"],["85"],"no-global-assign","no-unsafe-negation"]