Heapsort in Data Structure
There is a long queue at the billing counter of a mall. Some people have put all of their groceries in the cart and some have only 8-10 items. You have only a packet...
There is a long queue at the billing counter of a mall. Some people have put all of their groceries in the cart and some have only 8-10 items. You have only a packet...
Shell sort is one of the highly efficient algorithms. It is based on the insertion sort technique. The major difference between insertion sort and shell sort is that shell sort avoids large shifts of...
Suppose you are the head of an examination center. 4000 students are appearing for the examination and you have 50 invigilators at your center. After examination, you collect the answer sheets in random order....
Suppose you ran out of groceries. You run to a grocery store with a list of items with their priority numbers written alongside. For a small list, you can just see and find out...
Selection sort is a simple sorting where the control searches for the smallest element and puts it in the first index. In each iteration, it searches for the smallest element and puts it in...
Insertion sort is a sorting algorithm that most of us use in daily life. For example, while arranging a set of answer sheets in ascending order or arranging a deck of cards. After the...
Ever witnessed a car racing tournament? There are multiple laps in a race. While the race is in progress, let’s say team A is in 4th position. Team B is just behind team A...
A+B-(C*D)/E+X*Y- I am sure you must have seen this kind of expression at some point in your life. When you approach solving it, you assign the values to the variable and perform the operations...
Suppose you want to search for a word starting with ‘U’ in a dictionary. A dictionary has thousands of words arranged in ascending order. If you start from the beginning and keep on searching...
Let us consider a scenario where you have to find a book in your personal stack of books. Assuming that the stack is not arranged in any order, the only way to find a...