I have read that when pivot element is choosen as Median, then QS Algorithm gets nearly balanced splits and have time complexity of O(nlogn), but my doubt is what if all the elements of the input are ...

I've written a "quiz" that prompts the user for comparisons between two items of subjective value, and once the position of all of the items is determined, displays an ordered list from most valuable ...

For classic Heapsort (in this example using a maxheap), only the root node is extracted (popped) at each iteration and the last element in the heap is swapped into its place and then the tree is "re-...

I just came up with a simple sorting algorithm that is faster than ShellSort when the range of values is smaller than the number of elements.
Is this new? And if so, what should I do with it?
https:/...

What is the worst case example(input) for heap sort(for which input heap-sort behaves the worst)?
Discussion
When we consider a MAX-heap, then descending order sorted sequence, [ 16, 14, 10, 9, 8, 7, ...

Rules: A conveyor belt is giving you little boxes. They are labeled for your convenience: Box $1$, Box $2$,... For your inconvenience, though, you can't see the number (from $1...n$) hidden in it. You ...

I am asked to give a table of 8 elements that are to be sorted by the following algorithms and to produce their best cases.
1) Selection sort
2) Bubble sort
3) Insertion sort
4) Fusion sort
If I give ...

I'm trying to figure out the upper bound for the number of iterations of the bozo sort opt algorithm, described in this paper on section 3.2:
http://www.hermann-gruber.com/pdf/fun07-final.html
I know ...

I have a facial recognition algorithm that compares two images A and B and returns the likelihood that they match.
I also have 50,000 images, and I would like to sort these images into groups.
Here'...

So we have an unsorted array, we need to find the first $m$ elements in ascending order (or $m$ smallest elements) where $m = \mathrm{array.size}/2$ (or $n/2$). How would we do this in linear $O(n)$ ...

I'm trying to solve a constraint-satisfaction problem for a project of mine that seems like it should have a well-known solution, but I can't for the life of me seem to find it described anywhere.
I'...

Two $n$-size arays are given: $n_1$ is in decreasing order and $n_2$ is in increasing order.
Let $c_1$ be the time complexity for $n_1$ using quicksort, and $c_2$ the time complexity for $n_2$ using ...

In Quicksort we devide the array in to about an half (not worst case) and we have left and right sides so it is 2T(n/2), now why in the end it is T(n)=2T(n/2)+n as we may need to go over all the array ...

Disclaimer. What I'm going to ask about below may seem to be "Topological sorting". To my understanding, it is not. The latter runs in linear time, while I'm looking for a modification of the regular ...

I'm having trouble making an algorithm to fit these specs:
Given a complete binary tree ($n = 2^d$ leaves) with integers in leaves.
Reading the leaves from left to right makes a sequence of integers (...

Can't find a good way to tackle the problem. Would appreciate any help.
$A$ is an $n$ items array from an ordered set, in which every item is at most
$\log n $ indices away from its position in the ...

Given $n$ arrays. Each has size of $h$. Let $a_{i, j} \in \mathbb{I}$ be the $i$-th element of $j$-th array. You can select at most $k$ numbers from all arrays but if you pick $a_{i, j}$, you have to ...

I have been stuck on this sorting problem for a while now:
Given an array of length N find the minimum number of shift operations in order to sort the array. A shift operation is defined as shifting ...

This TED-ED video talks about some of the most basic sorting methods (bubble sort, insertion sort and quick sort,) in response to a scenario where a librarian ends up with a stack of 1,280 unsorted ...