-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 38.4 KB
/
.eslintcache
1
[{"C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\reportWebVitals.js":"1","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\App.js":"2","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\SortingVisualizer.js":"3","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\index.js":"4","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\algorithms\\bubbleSort.js":"5","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\ArrayComponent.js":"6","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\Utility.js":"7","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\Navbar.js":"8","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\algorithms\\mergeSort.js":"9","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\algorithms\\insertionSort.js":"10","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\algorithms\\quickSort.js":"11","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\AnimateComponent.js":"12"},{"size":362,"mtime":1606822222248,"results":"13","hashOfConfig":"14"},{"size":319,"mtime":1607348965431,"results":"15","hashOfConfig":"14"},{"size":2035,"mtime":1607857179144,"results":"16","hashOfConfig":"14"},{"size":500,"mtime":1606822222248,"results":"17","hashOfConfig":"14"},{"size":1236,"mtime":1607528551228,"results":"18","hashOfConfig":"14"},{"size":1449,"mtime":1607927779533,"results":"19","hashOfConfig":"14"},{"size":2636,"mtime":1607753875467,"results":"20","hashOfConfig":"14"},{"size":3843,"mtime":1607927779750,"results":"21","hashOfConfig":"14"},{"size":4030,"mtime":1607753875468,"results":"22","hashOfConfig":"14"},{"size":1525,"mtime":1607577376702,"results":"23","hashOfConfig":"14"},{"size":8308,"mtime":1607753875468,"results":"24","hashOfConfig":"14"},{"size":6513,"mtime":1607753875467,"results":"25","hashOfConfig":"14"},{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},"diiqdf",{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"31"},{"filePath":"32","messages":"33","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"34","usedDeprecatedRules":"31"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"37"},{"filePath":"38","messages":"39","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"40","usedDeprecatedRules":"41"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"44","usedDeprecatedRules":"31"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"47","usedDeprecatedRules":"28"},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"52","usedDeprecatedRules":"31"},{"filePath":"53","messages":"54","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"55"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"58","usedDeprecatedRules":"28"},{"filePath":"59","messages":"60","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"61","usedDeprecatedRules":"41"},"C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\reportWebVitals.js",[],["62","63"],"C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\App.js",[],["64","65"],"C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\SortingVisualizer.js",["66","67"],"import React , { useState,useEffect} from 'react';\r\n\r\nimport Navbar from './Navbar';\r\nimport Bars from './ArrayComponent';\r\nimport '../SortViz.css';\r\nimport {getRandomArray } from './Utility';\r\n\r\nexport const ANIMATION_SPEED = 1;//speed 1 10 100 1000\r\nexport const NO_OF_BARS = 100;\r\nexport const MIN_H = 20;\r\nexport const MAX_H = 420;\r\nexport const COLOR_CHECK = \"yellow\";\r\nexport const COLOR_OUT = \"red\";\r\nexport const COLOR_IN = \"green\";\r\nexport const COLOR_BAR = \"turquoise\";\r\nexport const COLOR_BLUE = \"blue\";\r\nexport const COLOR_SORTED = \"blueviolet\";\r\n\r\nexport const DELAY = 5;//5 milisec\r\n\r\n\r\n function SortingVisualizer (props) {\r\n\r\n const [array,setArray]=useState([]);\r\n const [sortType,setSortType] = useState('');\r\n const [arraySize, setArraySize] = useState(NO_OF_BARS);\r\n const [isSorting,setIsSorting] = useState(false);\r\n const [isSorted,setIsSorted] = useState(false);\r\n\r\n \r\n useEffect(()=>{\r\n setArray(getRandomArray(arraySize));\r\n },[])\r\n\r\n \r\n\r\n return(\r\n <div className = \"container\">\r\n <Navbar \r\n array = {array}\r\n setArray = {setArray}\r\n setSortType = {setSortType}\r\n arraySize = {arraySize}\r\n setArraySize = {setArraySize}\r\n isSorting = {isSorting}\r\n setIsSorting = {setIsSorting}\r\n isSorted = {isSorted}\r\n setIsSorted = {setIsSorted}\r\n />\r\n\r\n <Bars \r\n array = {array}\r\n \r\n sortType = {sortType}\r\n arraySize = {arraySize}\r\n isSorting = {isSorting}\r\n isSorted = {isSorted}\r\n \r\n />\r\n <footer className =\"footer\" >\r\n <div >Created by Aashutosh Shrivastav @2020<br/>\r\n To know more <a className =\"alink\" target = \"_blank\" href = \"https://aashutosh-shrivastav.github.io/mysite/\">click here</a> \r\n </div> \r\n </footer>\r\n\r\n </div>\r\n );\r\n}\r\n\r\nexport default SortingVisualizer;","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\index.js",[],["68","69"],"C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\algorithms\\bubbleSort.js",["70"],"import {testSort} from '../Utility';\r\n\r\nexport function bubbleSortAnimations (array){\r\n\r\n var arr =[...array] ;\r\n \r\n const animations = [];\r\n for(let i = 0; i <arr.length;i++){\r\n \r\n\r\n for(let j =1;j<arr.length - i ;j++){\r\n\r\n \r\n var compair = [];\r\n compair.push(j-1);\r\n compair.push(j);\r\n\r\n if(arr[j-1]>arr[j]){\r\n compair.push(true);\r\n compair.push(arr[j-1]);\r\n compair.push(arr[j]);\r\n \r\n animations.push(compair);\r\n \r\n\r\n var t=arr[j-1];\r\n arr[j-1] = arr[j];\r\n arr[j] = t;\r\n\r\n \r\n\r\n }\r\n else{\r\n compair.push(false);\r\n animations.push(compair);\r\n\r\n \r\n\r\n }\r\n\r\n \r\n\r\n }\r\n }\r\n //console.log(\"bubblesort input \" + array);\r\n\r\n //console.log(\"bubblesortd array : \" +arr);\r\n /* if(testSort(arr,array)){\r\n console.log(\"tested succesfull \");\r\n }\r\n else{\r\n console.log(\"tested unsuccesfull error in sort \");\r\n }\r\n */\r\n //console.log(animations);\r\n return animations;\r\n \r\n\r\n}\r\n\r\n",["71","72"],"C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\ArrayComponent.js",["73","74"],"import React ,{useState , useEffect}from 'react';\r\nimport {COLOR_BAR } from './SortingVisualizer';\r\nimport '../SortViz.css'; \r\n\r\n\r\n function Bars ({ array, sortType, arraySize,isSorting,isSorted}) {\r\n\r\n\r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n return(\r\n <div className = \"row \">\r\n <div className = \"col info-display\">\r\n State information<hr/>\r\n array size : {arraySize}\r\n <br/>\r\n array : {JSON.stringify(array)}\r\n <br/>\r\n sort type : {sortType}\r\n <br />\r\n is Sorting : {isSorting ? \"Yes \": \"No\"}\r\n <br/>\r\n is Sorted : {isSorted ? \"Yes\" :\"No\"}\r\n \r\n\r\n </div>\r\n <div className = \"col array-container\">\r\n {\r\n array.map((bar,index)=>{\r\n return(\r\n <div className = \"array-bar\" \r\n key = {index}\r\n style={{\r\n height : `${bar}px`,\r\n backgroundColor : COLOR_BAR\r\n }}>\r\n .\r\n </div>\r\n );\r\n })\r\n }\r\n </div>\r\n\r\n \r\n </div>\r\n );\r\n}\r\n\r\nexport default Bars ;","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\Utility.js",["75"],"import {MAX_H,MIN_H,DELAY} from './SortingVisualizer';\r\n\r\nexport function getRandomArray (arraySize){\r\n const arr = [];\r\n for(let i=0;i<arraySize;i++){\r\n arr.push(Math.floor(Math.random()*(MAX_H - MIN_H +1)+MIN_H));\r\n }\r\n //console.log(\"random array generated in Utility getrandom array \");\r\n return arr ;\r\n}\r\n\r\nexport const swap =(item1,item2 )=>{\r\n \r\n var temp = item1;\r\n item1 = item2;\r\n item2 = temp;\r\n\r\n return ;\r\n}\r\n\r\nexport function testSort(arr1,arr2){\r\n\r\n var arr3 =arr2;\r\n arr3.sort(function(a,b){return a-b});\r\n if(JSON.stringify(arr1)==JSON.stringify(arr3)){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n}\r\n\r\n// color manipulating function\r\n//tow index same color\r\nexport const colorChangeRequest = (idx1,idx2,color,Time) =>{\r\n //const aux = document.getElementsByClassName(\"array-bar\");\r\n setTimeout(()=>{\r\n //console.log(\"index : \"+idx1+\" and index :\"+idx2+\" color changed to : \"+ color +\" at time t:\"+Time+\" * \"+ DELAY+\" = \"+Time*DELAY+\" ms\");\r\n\r\n const aux = document.getElementsByClassName(\"array-bar\");\r\n\r\n aux[idx1].style.backgroundColor =color;\r\n aux[idx2].style.backgroundColor =color;\r\n\r\n },Time*DELAY);\r\n\r\n}\r\n//two index diffrent color\r\nexport const twocolorChangeRequest = (idx1,idx2,color1,color2,Time) =>{\r\n //const aux = document.getElementsByClassName(\"array-bar\");\r\n setTimeout(()=>{\r\n // console.log(\"index : \"+idx1+\" and index :\"+idx2+\" color changed to : \"+ color +\" at time t:\"+Time+\" * \"+ DELAY+\" = \"+Time*DELAY+\" ms\");\r\n\r\n const aux = document.getElementsByClassName(\"array-bar\");\r\n\r\n aux[idx1].style.backgroundColor =color1;\r\n aux[idx2].style.backgroundColor =color2;\r\n\r\n },Time*DELAY);\r\n\r\n}\r\n//single index single color\r\n\r\nexport const singlecolorChangeRequest = (idx1,color1,Time) =>{\r\n //const aux = document.getElementsByClassName(\"array-bar\");\r\n setTimeout(()=>{\r\n // console.log(\"index : \"+idx1+\" and index :\"+idx2+\" color changed to : \"+ color +\" at time t:\"+Time+\" * \"+ DELAY+\" = \"+Time*DELAY+\" ms\");\r\n\r\n const aux = document.getElementsByClassName(\"array-bar\");\r\n\r\n aux[idx1].style.backgroundColor =color1;\r\n\r\n },Time*DELAY);\r\n}\r\n\r\n// height manipulating function\r\n\r\nexport const heightChangeRequest = (idx,height,Time) =>{\r\n\r\n setTimeout(()=>{\r\n //console.log(\"index : \"+idx+\" height changed to : \"+ height +\" at time t: \"+Time+\" * \"+ DELAY+\" = \"+Time*DELAY+\" ms\");\r\n const aux = document.getElementsByClassName(\"array-bar\");\r\n\r\n aux[idx].style.height = `${height}px`;\r\n\r\n },Time*DELAY);\r\n}\r\n\r\n","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\Navbar.js",[],"C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\algorithms\\mergeSort.js",["76","77","78","79","80","81"],"import {testSort} from '../Utility';\r\n\r\n\r\nexport function mergeSortAnimations (array) { \r\n \r\n let animations = [];\r\n\r\n function mergeSort(temp,startIndex){\r\n //console.log(temp);\r\n //console.log(startIndex);\r\n if(temp.length===1){\r\n return temp;\r\n }\r\n\r\n const middle = Math.floor(temp.length / 2);\r\n const left = temp.slice(0,middle);\r\n const right = temp.slice(middle);\r\n\r\n return merge(mergeSort(left,startIndex),mergeSort(right,startIndex+left.length),startIndex);\r\n\r\n }\r\n\r\n function merge(left,right,k){\r\n let result = [];\r\n let leftIndex = 0;\r\n let rightIndex = 0;\r\n \r\n var compair = [];\r\n\r\n while(leftIndex < left.length && rightIndex < right.length ) {\r\n\r\n if( left[leftIndex] < right[rightIndex] ){\r\n // li ri fal\r\n compair=[] ;\r\n\r\n compair.push(false);\r\n compair.push(k+leftIndex);\r\n compair.push(k+left.length+rightIndex);\r\n compair.push(false);\r\n compair.push(k+result.length);\r\n compair.push(left[leftIndex]);\r\n animations.push(compair);\r\n \r\n //console.log(\"compairing position \"+(k +leftIndex)+\" and \"+(k+left.length+rightIndex) +\" putting value at \"+k+\" + \"+result.length+\" = \"+(k+result.length)+\" = \"+ left[leftIndex]);\r\n result.push(left[leftIndex]);\r\n leftIndex++;\r\n }else{\r\n //li ri true r[ri]\r\n compair=[] ;\r\n\r\n compair.push(false);\r\n compair.push(k+leftIndex);\r\n compair.push(k+left.length+rightIndex);\r\n compair.push(true);\r\n compair.push(k+result.length);\r\n compair.push(right[rightIndex]);\r\n animations.push(compair);\r\n \r\n //console.log(\"compairing position \"+(k +leftIndex)+\" and \"+(k+left.length+rightIndex) +\" putting value at \"+k+\" + \"+result.length+\" = \"+(k+result.length)+\" = \"+ right[rightIndex]);\r\n\r\n result.push(right[rightIndex]);\r\n rightIndex++;\r\n }\r\n }\r\n\r\n if(leftIndex == left.length && rightIndex == right.length){\r\n return result;\r\n }\r\n else if(leftIndex == left.length && rightIndex < right.length){\r\n while(rightIndex < right.length){\r\n \r\n compair=[] ;\r\n compair.push(true);\r\n compair.push(k+result.length);\r\n compair.push(right[rightIndex]);\r\n animations.push(compair);\r\n \r\n //console.log(\" move value at position \"+(k+left.length+rightIndex) +\" to putting value at \"+k+\" + \"+result.length+\" = \"+(k+result.length)+\" = \"+ right[rightIndex] );\r\n result.push(right[rightIndex]);\r\n rightIndex++;\r\n }\r\n return result;\r\n }\r\n else if(leftIndex < left.length && rightIndex == right.length){\r\n while(leftIndex < left.length){\r\n\r\n compair=[] ;\r\n compair.push(true);\r\n compair.push(k+result.length);\r\n compair.push(left[leftIndex]);\r\n animations.push(compair);\r\n //console.log(\" move value at position \"+(k+leftIndex) +\" to putting value at \"+k+\" + \"+result.length+\" = \"+(k+result.length)+\" = \"+ left[leftIndex] );\r\n\r\n result.push(left[leftIndex]);\r\n leftIndex++;\r\n }\r\n return result;\r\n }\r\n }\r\n var temp = [...array];\r\n var arr = mergeSort(temp,0);\r\n // console.log(\"mergesort input \" + temp);\r\n\r\n //console.log(\"merge sorted array : \" +arr);\r\n /* if(testSort(arr,array)){\r\n console.log(\"tested succesfull \");\r\n }\r\n else{\r\n console.log(\"tested unsuccesfull error in sort \");\r\n }\r\n */\r\n return animations;\r\n}","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\algorithms\\insertionSort.js",["82","83"],"import {testSort } from '../Utility';\r\n\r\nexport function insertionSortAnimations (array){\r\n\r\n var animations = [];\r\n\r\n var arr =[...array] ;\r\n\r\n for(let i=1;i<arr.length;i++){\r\n \r\n let cur = arr[i];\r\n let j=i-1;\r\n // i y\r\n \r\n while(j>-1 && cur < arr[j] ){\r\n // j+1, j check y r g o \r\n var compair = [];\r\n\r\n compair.push(j);\r\n compair.push(j+1);\r\n compair.push(true);\r\n compair.push(arr[j]);\r\n compair.push(arr[j+1]);\r\n\r\n animations.push(compair);\r\n \r\n arr[j+1]=arr[j];\r\n //additional step for better anim\r\n arr[j] =cur;\r\n //decrementing for while loop\r\n j--;\r\n } \r\n \r\n //j+1 y g o\r\n // j!== -1 condition for j==0 condition satisfied in the while loop\r\n if(j!==-1){\r\n var compair = [];\r\n\r\n compair.push(j);\r\n compair.push(j+1);\r\n compair.push(false);\r\n\r\n animations.push(compair);\r\n\r\n arr[j+1]=cur;\r\n }\r\n }\r\n\r\n //console.log(\"insertionsort input \" + array);\r\n\r\n //console.log(\"insertion sorted array : \" +arr);\r\n /* if(testSort(arr,array)){\r\n console.log(\"tested succesfull \");\r\n }\r\n else{\r\n console.log(\"tested unsuccesfull error in sort \");\r\n }\r\n */\r\n console.log(animations);\r\n return animations;\r\n\r\n}","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\algorithms\\quickSort.js",["84","85"],"import {testSort} from '../Utility';\r\nexport function quickSortAnimations (array){\r\n var animations = [];\r\n var arr =[...array] ;\r\n \r\n\r\n function partition(arr, start, end){\r\n const pivotValue = arr[end];\r\n let pivotIndex = start; \r\n var compair = [];\r\n\r\n compair.push(true);\r\n compair.push(pivotIndex);\r\n\r\n animations.push(compair);\r\n for (let i = start; i < end; i++) {\r\n if (arr[i] < pivotValue) {\r\n compair = [];\r\n\r\n compair.push(false);\r\n compair.push(true);\r\n compair.push(true);\r\n compair.push(i);\r\n compair.push(end);\r\n\r\n animations.push(compair);\r\n\r\n\r\n compair = [];\r\n\r\n compair.push(false);\r\n compair.push(false);\r\n compair.push(i);\r\n compair.push(pivotIndex);\r\n compair.push(arr[i]);\r\n compair.push(arr[pivotIndex]);\r\n \r\n animations.push(compair);\r\n\r\n //console.log(arr[i]+\" < \"+pivotValue+\" swap arr[\"+i+\"] to \"+arr[pivotIndex]+\"swap arr[\"+pivotIndex+\"] to \"+arr[i]);\r\n\r\n [arr[i], arr[pivotIndex]] = [arr[pivotIndex], arr[i]];\r\n // Moving to next element\r\n pivotIndex++;\r\n\r\n compair = [];\r\n compair.push(true);\r\n compair.push(pivotIndex);\r\n animations.push(compair);\r\n }else{\r\n\r\n compair = [];\r\n \r\n compair.push(false);\r\n compair.push(true);\r\n compair.push(false);\r\n compair.push(i);\r\n compair.push(end);\r\n\r\n animations.push(compair);\r\n }\r\n }\r\n // console.log(\"swap arr[\"+pivotIndex+\"] to \"+arr[end]+\"swap arr[\"+end+\"] to \"+arr[pivotIndex]);\r\n compair = [];\r\n\r\n compair.push(false);\r\n compair.push(false);\r\n compair.push(pivotIndex);\r\n compair.push(end);\r\n compair.push(arr[pivotIndex]);\r\n compair.push(arr[end]);\r\n\r\n animations.push(compair);\r\n [arr[pivotIndex], arr[end]] = [arr[end], arr[pivotIndex]] ;\r\n \r\n \r\n return pivotIndex;\r\n};\r\n\r\n\r\nfunction quickSort(arr, start, end) {\r\n ///k is no of element before start for referenceing in animations array\r\n // Base case or terminating case\r\n if (start >= end) {\r\n return;\r\n }\r\n \r\n // Returns pivotIndex\r\n let index = partition(arr, start, end);\r\n //console.log(\" In the quicksort start :\" +start+\" end : \" +end+\" pivot : \"+index);\r\n \r\n \r\n \r\n // Recursively apply the same logic to the left and right subarrays\r\n //console.log(\"start \"+start+\" end \"+(index-1));\r\n quickSort(arr, start, index - 1);\r\n //console.log(\"start \"+(index+1)+\" end \"+(end));\r\n quickSort(arr, index + 1, end);\r\n\r\n return arr;\r\n};\r\n/*\r\nexport function xquickSortAnimations (array){\r\n var animations = [];\r\n var arr =[...array] ;\r\n for (let i = start; i < end; i++) {\r\n \r\n if (arr[i] < pivotValue) {\r\n\r\n function partition(arr, start, end,k){\r\n //k is no of element before start for referenceing in animations array\r\n // Taking the last element as the pivot\r\n const pivotValue = arr[end];\r\n let pivotIndex = start; \r\n \r\n console.log(\"start :\" +start+\" end : \" +end+\" pivot : \"+pivotIndex+\" k : \"+k +\" k+pivotIndex = \"+(k+pivotIndex));\r\n //pi b+o (ispivot ,pivotindex)\r\n \r\n var compair = [];\r\n\r\n compair.push(true);\r\n compair.push(k+pivotIndex);\r\n\r\n animations.push(compair);\r\n \r\n\r\n for (let i = start; i < end; i++) {\r\n \r\n if (arr[i] < pivotValue) {\r\n //(ispivot = false ,iscomapir =true ,compairval = true ,i ,end )\r\n // compair i and end =>y if i<e =>g then swap (i1,i2,v1,v2) else if i>=e =>red =>o pivot =>b =>o \r\n // Swapping elements\r\n console.log( \"in the loop comparison = true cvaal = true \");\r\n console.log(\"arr[\"+i+\"] < \"+\"arr[\"+end+\"] = \"+arr[i] +\" < \"+arr[end]+\" ie \"+pivotValue);\r\n console.log(\"in animation push index \"+(k+i)+\" and \"+(k+end));\r\n \r\n \r\n compair = [];\r\n\r\n compair.push(false);\r\n compair.push(true);\r\n compair.push(true);\r\n compair.push(k+i);\r\n compair.push(k+end);\r\n\r\n animations.push(compair);\r\n \r\n\r\n //swap ispivot =false ,is compair =false,i,pi,arr[i],arr[pi]\r\n console.log(\"in loop is pivot =false iscomparison =false is swapping \");\r\n console.log(\"swap values at index \"+i+\" and \"+pivotIndex+\" with value \"+arr[i]+\" and \"+arr[pivotIndex]+\"global index val at index ; \"+(k+i)+\" and\"+(k+pivotIndex) );\r\n \r\n\r\n \r\n compair = [];\r\n\r\n compair.push(false);\r\n compair.push(false);\r\n compair.push(k+i);\r\n compair.push(k+pivotIndex);\r\n compair.push(arr[k+i]);\r\n compair.push(arr[k+pivotIndex]);\r\n\r\n animations.push(compair);\r\n \r\n [arr[i], arr[pivotIndex]] = [arr[pivotIndex], arr[i]];\r\n // Moving to next element\r\n pivotIndex++;\r\n console.log(\"start :\" +start+\" end : \" +end+\" pivot : \"+pivotIndex+\" k : \"+k +\" k+pivotIndex = \"+(k+pivotIndex));\r\n\r\n \r\n compair = [];\r\n compair.push(true);\r\n compair.push(k+pivotIndex);\r\n animations.push(compair);\r\n \r\n \r\n }\r\n else{\r\n console.log( \"in the loop pivot =false comparison = true cvaal = false \");\r\n console.log(\"arr[\"+i+\"] > \"+\"arr[\"+end+\"] = \"+arr[i] +\" > \"+arr[end]+\" ie \"+pivotValue);\r\n console.log(\"in animation push index \"+(k+i)+\" and \"+(k+end));\r\n \r\n compair = [];\r\n \r\n compair.push(false);\r\n compair.push(true);\r\n compair.push(false);\r\n compair.push(k+i);\r\n compair.push(k+end);\r\n\r\n animations.push(compair);\r\n \r\n }\r\n }\r\n //pi and e =>y +r h +g o\r\n // Putting the pivot value in the middle\r\n //swap aniimation\r\n \r\n compair = [];\r\n\r\n compair.push(false);\r\n compair.push(false);\r\n compair.push(k+pivotIndex);\r\n compair.push(k+end);\r\n compair.push(arr[k+pivotIndex]);\r\n compair.push(arr[k+end]);\r\n\r\n animations.push(compair);\r\n \r\n console.log(\"out of loop is pivot =false iscomparison =false is swapping \");\r\n console.log(\"swap values at index \"+pivotIndex+\" and \"+end+\" with value \"+arr[pivotIndex]+\" and \"+arr[end]+\"global index val at index ; \"+(k+pivotIndex)+\" and\"+(k+end) );\r\n \r\n [arr[pivotIndex], arr[end]] = [arr[end], arr[pivotIndex]] \r\n // p\r\n\r\n return pivotIndex;\r\n };\r\n\r\n\r\n function xquickSort(arr, start, end,k) {\r\n ///k is no of element before start for referenceing in animations array\r\n // Base case or terminating case\r\n if (start >= end) {\r\n return;\r\n }\r\n \r\n // Returns pivotIndex\r\n let index = partition(arr, start, end,k);\r\n console.log(\" In the quicksort start :\" +start+\" end : \" +end+\" pivot : \"+index+\" k : \"+k +\" k+pivotIndex = \"+(k+index));\r\n\r\n var compair = [];\r\n compair.push(true);\r\n compair.push(k+index);\r\n animations.push(compair);\r\n \r\n // Recursively apply the same logic to the left and right subarrays\r\n quickSort(arr, start, index - 1,k);\r\n quickSort(arr, index + 1, end,k+index+1);\r\n\r\n return arr;\r\n };\r\n*/\r\n var temp =quickSort(arr,0,arr.length-1);\r\n\r\n //console.log(\"quicksort input \" + array);\r\n\r\n //console.log(\"quick sorted array : \" +temp);\r\n /* if(testSort(temp,array)){\r\n console.log(\"tested succesfull \");\r\n }\r\n else{\r\n console.log(\"tested unsuccesfull error in sort \");\r\n }\r\n */\r\n \r\n return animations;\r\n \r\n}","C:\\Users\\Friends\\Documents\\SortingVisualizer\\sorting-visualizer\\src\\components\\AnimateComponent.js",["86","87","88","89"],"import { ANIMATION_SPEED,DELAY,MAX_H,MIN_H,COLOR_BAR,COLOR_CHECK,COLOR_IN,COLOR_OUT,COLOR_BLUE,COLOR_SORTED,NO_OF_BARS,} from './SortingVisualizer';\r\nimport {colorChangeRequest,heightChangeRequest,singlecolorChangeRequest,twocolorChangeRequest} from './Utility';\r\n\r\nexport function deployAnimations(animations,setIsSorting,setIsSorted){\r\n\r\n var time = 0;\r\n \r\n \r\n\r\n \r\n\r\n for(let i=0;i<animations.length;i++) {\r\n\r\n if(animations[i][2]){\r\n \r\n const index1 = animations[i][0];\r\n const index2 = animations[i][1];\r\n const height1 = animations[i][3];\r\n const height2 = animations[i][4];\r\n \r\n colorChangeRequest(index1,index2,COLOR_CHECK,time);//yellow\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_OUT,time);//red\r\n time++;\r\n heightChangeRequest(index1,height2,time);\r\n time++;\r\n heightChangeRequest(index2,height1,time);\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_IN,time);//green\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_BAR,time);//torqoise\r\n time++;\r\n }else{\r\n const index1 = animations[i][0];\r\n const index2 = animations[i][1]; \r\n \r\n colorChangeRequest(index1,index2,COLOR_CHECK,time);//yellow\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_IN,time);//green\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_BAR,time);//torqoise\r\n time++;\r\n }\r\n }\r\n\r\n //console.log(\"animation loop end setTimeout stack prepared ;\");\r\n sortCompletedAnimation(time,setIsSorting,setIsSorted);\r\n\r\n \r\n}\r\n\r\n//merge sort animation reader and deployer \r\nexport function deployMergeAnimations(animations,setIsSorting,setIsSorted){\r\n\r\n\r\n var time = 0;\r\n for(let i=0;i<animations.length;i++) {\r\n if(!animations[i][0]){\r\n //compair index1 and 2\r\n const index1 = animations[i][1];\r\n const index2 = animations[i][2];\r\n\r\n if(animations[i][3]){\r\n // change height with right < left \r\n colorChangeRequest(index1,index2,COLOR_CHECK,time);\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_OUT,time);\r\n time++;\r\n \r\n heightChangeRequest(animations[i][4],animations[i][5],time);\r\n time++;\r\n twocolorChangeRequest(index1,index2,COLOR_IN,COLOR_BLUE,time);\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_BAR,time);//torqoise\r\n time++;\r\n\r\n\r\n\r\n }else{\r\n // change height with right > left \r\n\r\n colorChangeRequest(index1,index2,COLOR_CHECK,time);\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_IN,time);\r\n time++;\r\n \r\n heightChangeRequest(animations[i][4],animations[i][5],time);\r\n time++;\r\n \r\n colorChangeRequest(index1,index2,COLOR_BAR,time);//torqoise\r\n time++;\r\n\r\n }\r\n\r\n\r\n }else{\r\n const index1 = animations[i][1];\r\n\r\n \r\n singlecolorChangeRequest(index1,COLOR_BLUE,time);\r\n time++;\r\n heightChangeRequest(index1,animations[i][2],time);\r\n time++;\r\n singlecolorChangeRequest(index1,COLOR_IN,time);\r\n time++;\r\n singlecolorChangeRequest(index1,COLOR_BAR,time);\r\n time++;\r\n }\r\n }\r\n\r\n//console.log(\"merge sort animation stack started \");\r\nsortCompletedAnimation(time,setIsSorting,setIsSorted);\r\n\r\n}\r\n//quick sort aniamtions reader and deployer\r\nexport function deployQuickAnimations(animations,setIsSorting,setIsSorted){\r\n\r\n var time =0;\r\n\r\n for(let i=0;i<animations.length;i++){\r\n\r\n if(animations[i][0]){\r\n //is pivot\r\n const index1 = animations[i][1];\r\n singlecolorChangeRequest(index1,COLOR_BLUE,time);\r\n time++;\r\n singlecolorChangeRequest(index1,COLOR_BAR,time);\r\n time++;\r\n }\r\n else{\r\n //not a pivot but comparison or swap\r\n if(animations[i][1]){\r\n //comparison is accuring \r\n const index1 = animations[i][3];\r\n const index2 = animations[i][4];\r\n\r\n if(animations[i][2]){\r\n // green make smaller element on left side by swapping in next animation\r\n colorChangeRequest(index1,index2,COLOR_CHECK,time);\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_IN,time);\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_BAR,time);\r\n time++;\r\n\r\n\r\n }else{\r\n //red already on the right side of pivot\r\n colorChangeRequest(index1,index2,COLOR_CHECK,time);\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_OUT,time);\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_BAR,time);\r\n time++;\r\n }\r\n\r\n }else{\r\n //not a pivot and compairison then its swap aniamation\r\n const index1 = animations[i][2];\r\n const index2 = animations[i][3];\r\n const val1 = animations[i][4];\r\n const val2 = animations[i][5];\r\n\r\n colorChangeRequest(index1,index2,COLOR_BLUE,time);\r\n time++;\r\n heightChangeRequest(index1,val2,time);\r\n time++;\r\n heightChangeRequest(index2,val1,time);\r\n time++;\r\n colorChangeRequest(index1,index2,COLOR_BAR,time);\r\n time++;\r\n\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n //console.log(\"animation for quick sort loaded\");\r\n\r\n sortCompletedAnimation(time,setIsSorting,setIsSorted);\r\n\r\n}\r\n\r\nexport function sortCompletedAnimation(time,setIsSorting,setIsSorted){\r\n for(let i=0;i<NO_OF_BARS;i++){\r\n singlecolorChangeRequest(i,COLOR_SORTED,time);\r\n time++;\r\n\r\n }\r\n setTimeout(()=>{\r\n setIsSorting(false);\r\n setIsSorted(true);\r\n },time);\r\n //console.log(\"sorting ended at time t = \"+(time*DELAY)+\"sec\" );\r\n}\r\n\r\n",{"ruleId":"90","replacedBy":"91"},{"ruleId":"92","replacedBy":"93"},{"ruleId":"90","replacedBy":"94"},{"ruleId":"92","replacedBy":"95"},{"ruleId":"96","severity":1,"message":"97","line":33,"column":7,"nodeType":"98","endLine":33,"endColumn":9,"suggestions":"99"},{"ruleId":"100","severity":1,"message":"101","line":62,"column":56,"nodeType":"102","endLine":62,"endColumn":73},{"ruleId":"90","replacedBy":"103"},{"ruleId":"92","replacedBy":"104"},{"ruleId":"105","severity":1,"message":"106","line":1,"column":9,"nodeType":"107","messageId":"108","endLine":1,"endColumn":17},{"ruleId":"90","replacedBy":"109"},{"ruleId":"92","replacedBy":"110"},{"ruleId":"105","severity":1,"message":"111","line":1,"column":16,"nodeType":"107","messageId":"108","endLine":1,"endColumn":24},{"ruleId":"105","severity":1,"message":"112","line":1,"column":27,"nodeType":"107","messageId":"108","endLine":1,"endColumn":36},{"ruleId":"113","severity":1,"message":"114","line":25,"column":28,"nodeType":"115","messageId":"116","endLine":25,"endColumn":30},{"ruleId":"105","severity":1,"message":"106","line":1,"column":9,"nodeType":"107","messageId":"108","endLine":1,"endColumn":17},{"ruleId":"113","severity":1,"message":"114","line":66,"column":22,"nodeType":"115","messageId":"116","endLine":66,"endColumn":24},{"ruleId":"113","severity":1,"message":"114","line":66,"column":51,"nodeType":"115","messageId":"116","endLine":66,"endColumn":53},{"ruleId":"113","severity":1,"message":"114","line":69,"column":27,"nodeType":"115","messageId":"116","endLine":69,"endColumn":29},{"ruleId":"113","severity":1,"message":"114","line":84,"column":55,"nodeType":"115","messageId":"116","endLine":84,"endColumn":57},{"ruleId":"105","severity":1,"message":"117","line":101,"column":9,"nodeType":"107","messageId":"108","endLine":101,"endColumn":12},{"ruleId":"105","severity":1,"message":"106","line":1,"column":9,"nodeType":"107","messageId":"108","endLine":1,"endColumn":17},{"ruleId":"118","severity":1,"message":"119","line":37,"column":17,"nodeType":"107","messageId":"120","endLine":37,"endColumn":24},{"ruleId":"105","severity":1,"message":"106","line":1,"column":9,"nodeType":"107","messageId":"108","endLine":1,"endColumn":17},{"ruleId":"105","severity":1,"message":"121","line":244,"column":9,"nodeType":"107","messageId":"108","endLine":244,"endColumn":13},{"ruleId":"105","severity":1,"message":"122","line":1,"column":10,"nodeType":"107","messageId":"108","endLine":1,"endColumn":25},{"ruleId":"105","severity":1,"message":"123","line":1,"column":26,"nodeType":"107","messageId":"108","endLine":1,"endColumn":31},{"ruleId":"105","severity":1,"message":"124","line":1,"column":32,"nodeType":"107","messageId":"108","endLine":1,"endColumn":37},{"ruleId":"105","severity":1,"message":"125","line":1,"column":38,"nodeType":"107","messageId":"108","endLine":1,"endColumn":43},"no-native-reassign",["126"],"no-negated-in-lhs",["127"],["126"],["127"],"react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'arraySize'. Either include it or remove the dependency array. You can also replace multiple useState variables with useReducer if 'setArray' needs the current value of 'arraySize'.","ArrayExpression",["128"],"react/jsx-no-target-blank","Using target=\"_blank\" without rel=\"noreferrer\" is a security risk: see https://html.spec.whatwg.org/multipage/links.html#link-type-noopener","JSXAttribute",["126"],["127"],"no-unused-vars","'testSort' is defined but never used.","Identifier","unusedVar",["126"],["127"],"'useState' is defined but never used.","'useEffect' is defined but never used.","eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","'arr' is assigned a value but never used.","no-redeclare","'compair' is already defined.","redeclared","'temp' is assigned a value but never used.","'ANIMATION_SPEED' is defined but never used.","'DELAY' is defined but never used.","'MAX_H' is defined but never used.","'MIN_H' is defined but never used.","no-global-assign","no-unsafe-negation",{"desc":"129","fix":"130"},"Update the dependencies array to be: [arraySize]",{"range":"131","text":"132"},[982,984],"[arraySize]"]