Questions tagged [sorting]
Sorting is the process of applying some order to a collection of items.
1,066
questions
8
votes
4answers
794 views
6
votes
2answers
452 views
Sorted grep in Haskell
This program implements a sorted grep, that is, a specialized version of grep for sorted files. It uses binary search for the lines of a file that begin with a ...
4
votes
2answers
270 views
Optimizing error-sorting method
I just made this sort method. It runs fine and the code looks okay in my eyes.
Is is possible to optimize it so it runs faster? If it's \$O(n^3)\$ now, it would be interesting changing it to \$O(n^2)...
15
votes
2answers
1k views
Is this C++ quicksort program okay?
I wrote a quicksort program in C++.
Is it okay to implement it this way?
Am I using pointers correctly?
Is my style okay?
Any ideas to speed it up or save memory?
...
7
votes
4answers
3k views
Heapsort is not modular
For the time being, I am not interested in any recursive solution. The code is not modularized; the whole body is inside the main function.
...
0
votes
3answers
995 views
8
votes
3answers
42k views
Sorting algorithms implemented in C++
Implemented
Bubble Sort, Insertion Sort, Selection Sort,
Quick Sort, Merge Sort and
Radix Sort
https://code.google.com/p/medicine-cpp/source/browse/trunk/cpp/sorting/SortingAlgorithms.cpp
...
26
votes
5answers
79k views
Java Implementation of Quick Sort
This is my implementation of quicksort (algorithm taken from Cormen book). This is an in place implementation. Please let us know issues with this or any ideas to make it better. It performs at logN.
...
4
votes
4answers
722 views
My own quicksort algorithm
I will make it more reader friendly after I get the algorithm completed. Does anything with the quick sort algorithm stand out as for why it is not working 100%? This is not homework; I am just ...
4
votes
6answers
2k views
6
votes
3answers
540 views
Khan inspired Insertion Sort
I just watched a Khan Academy video on Insertion Sort and I've tried to write an implementation in Python. Please suggest corrections or improvements on this program:
...
8
votes
2answers
1k views
Using bucket sort to rank students based on their marks
Problem:
n students have marks and names. Rank students based on their marks and print their names.
...
7
votes
1answer
844 views
Merge sort and selection sort comparison taking too long
I have this python code that compares merge sort and selection sort, but it is taking "forever."
...
9
votes
2answers
634 views
5
votes
3answers
939 views
37
votes
5answers
4k views
Sorting strings by length - functional Python
I'm trying to port this little F# snippet while staying pythonic:
...