Blogged By: Makrand Ballal
Today we have discussed about various methods of sorting. Basically these methods are the unconventional methods of sorting. We discuss these as a part of developing the logic for the programming. Today we have discussed many questions of sorting numbers in an array.
Q. In how many steps (condition and swap) can you sort three numbers
Q. How can we sort 4 numbers in 5 steps.
Q. We use a coin toss to decide between two choices. How many times do we have to toss do decide between 4 choices.
Q. We use a coin toss to decide between two choices. How many times do we have to toss do decide between 3 choices and how.
Q. Next we discussed one question in which there is an array which has numbers from 1025901 to 1025964 in random order. How to sort this array in O(n) ?
Q. If an array contains 100 numbers with only 3 distinct values. How to sort this array in O(n) ?
Students were able to device ways to solve the problems given. Some students also found ways to Solve the 3 way tossing problem in a completly out of box way in which Sir had also not envisaged
No comments:
Post a Comment