Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
134 views

I'm studying sorting algorithms at the moment and I have one question that is actually quite well-known but still I can't find a full answer that is comprehensive enough for me. So, the topic is libc++...
nastyAA's user avatar
  • 11
-2 votes
1 answer
175 views

I’m trying to implement an in-place Quick Sort in Python. I have two slightly different versions of my partitioning logic, and I’m confused because both seem correct on small arrays, but the second ...
Lisguen's user avatar
  • 11
2 votes
1 answer
66 views

I have a question regarding the following code I found on github: fun quicksort nil = nil | quicksort (pivot :: rest) = let fun split(nil) = (nil,nil) | split(x :: xs) = ...
dvk512's user avatar
  • 59
1 vote
2 answers
107 views

I am trying to sort the tuples in the 2D array based on a single column value similar to Javascript's sort function. arr.sort((a,b) => a[0] - b[0]) C Code : #include<stdio.h> #...
Bittu970's user avatar
  • 107
0 votes
1 answer
66 views

For this assignment I'm supposed to test my quicksort class using a variety of different pivots and a variety of ArrayLists in different arrangements. The class works fine with a random pivot, or a ...
Drake's user avatar
  • 19
0 votes
1 answer
87 views

In pp.296 Sedgewick & et al.'s Algorithm, 4rd edition, the author wrote: The optimum value of the cutoff M is system-dependent, but any value between 5 and 15 is likely to work well in most ...
Kt Student's user avatar
1 vote
1 answer
140 views

I am trying to the run the following quick sort algorithm and get the following error when I debug it with gdb: Program received signal SIGSEGV, Segmentation fault. 0x000055555555530a in partition (...
skm's user avatar
  • 43
0 votes
1 answer
68 views

I have written an assignment for a data structures class and am having trouble figuring out how to "Implement the main quicksort function that recursively sorts the subarrays formed by ...
Gabriel Denney-Martell's user avatar
2 votes
0 answers
137 views

I heard a long time ago that the implementation of the qsort function is the quick sorting algorithm and has a worst-case time complexity of n^2. But recently when I was trying to construct a set of ...
Sihan Lv's user avatar
1 vote
0 answers
67 views

I'm trying to make a code that counts Shell and Merge comparisons and swaps, making a sum between the sum of the comps and swaps. The vectors are a subArray, such that, given: 4 (line break here) 3 6 ...
Poueeerr's user avatar
0 votes
0 answers
46 views

I'm trying to implement the quicksort algorithm using recursion in Javascript and while I'm return when I meet the base case it's not happening. Please help me. Following is the code I've written. ...
mallikarjun's user avatar
0 votes
1 answer
94 views

I am implementing a parallel quicksort: Partition the input range, Conquer the left subrange in this thread. Conquer the right subrange in a new (single) thread while (2) is running. In OpenMP, how ...
coderodde's user avatar
  • 957
3 votes
1 answer
121 views

I've been working on implementing the Quicksort algorithm in Java, but I seem to be encountering an issue where the array is not sorted correctly. Here is my code: public class QuickSort { ...
Sasindi Wijethunga's user avatar
0 votes
2 answers
91 views

I am finding the recursion depth or the level of the best case for the quick sort algorithm. Reference book, Google and all other resources all giving me the answer that recursion depth of the best ...
Jin's user avatar
  • 1
0 votes
1 answer
127 views

The threeway partitioning problem which uses a left, mid and right pointer to swap the values for numbers which are less than lowVal between lowVal and highVal and greater than highVal. It is not ...
rog05's user avatar
  • 16
0 votes
0 answers
22 views

I have an array filled with objects "fruits" which have properties "kind", "color". I need to use quicksort method to sort given fruits by their colors in accordance to ...
user25296678's user avatar
2 votes
1 answer
151 views

I need to use the Quicksort sorting algorithm to sort elements of a linked list. It is important to note that I must not just swap the key values, but the elements themselves. My code simply does not ...
Besouro Branco's user avatar
2 votes
1 answer
216 views

I've been trying to understand quick sort by implementing it myself in Python using the left and right pointer method. I can't seem to get it to work and looking at visualizations online, I'm failing ...
Kirency's user avatar
  • 61
0 votes
1 answer
75 views

I mainly do python because its in my school syllabus, but I enjoy java(I am still fairly new to it). I was trying to make a quick sort program(recursive) in java but a typical stackoverflow occurs.I'...
Arnav joharwal's user avatar
0 votes
2 answers
99 views

I tried to adapt this example from K&R (5.11, ANSI edition) to sort an array of ints but it crashes randomly and I can't figure why. The original version sorted "lines" : char *lineptr[...
qkzk's user avatar
  • 297
-2 votes
1 answer
79 views

I have read recently that C# uses Quicksort algorithm to sort an array. What I would like to know whether C# uses recursive approach or iterative approach? What I have found is this link and it looks ...
Learner's user avatar
  • 675
0 votes
1 answer
62 views

I implemented my QuickSort algorithm as follows. The sortArray function the entry point for sorting the array. It initializes the lower and upper bounds of the array and then calls the quicksort ...
blazingcannon's user avatar
1 vote
0 answers
48 views

I have this code, and the time complexity is 𝑂(𝑛 log (𝑚)+𝑚𝑙𝑜𝑔(𝑚))  but I now I need a code that does the same thing but with a time complexity of 𝑂(𝑛 log (𝑛)+𝑚𝑙𝑜𝑔(𝑛)) , I do not ...
Leah M's user avatar
  • 21
0 votes
0 answers
226 views

I'm a second semester computer science engineering student and I had to measure the time taken for recursive/iterative quick sort implementations to sort vectors of length 1-500 and graph using C++ ...
Tested First's user avatar
0 votes
1 answer
151 views

I have an assignment to create a quicksort algorithm which chooses the last element as the pivot element. Further inside the partition() function when an Element n is found which is greater or equal ...
Apollox's user avatar
  • 27

1
2 3 4 5
66