Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Sort an array with only one local variable

Array sorting algorithm question is frequently asked during technical interviews. There are lots of sort algorithms including bubble sort, selection sort, insertion sort, quick sort, merge sort etc. Usually interviewees will be asked to implement sort algorithms. But have you ever been asked to sort an array which you are allowed to define ONLY ONE local variable in your algorithm? Bubble sort can be used to do this actually. Normally a bubble sort algorithm may need three local variables : the index variable, the boolean variable to determine whether continue, a temp varia...

5,094 3       JAVASCRIPT ALGORITHM SORTING BUBBLE SORT