Efficient Sorting Method

If we add a element to the last of a sorted sequence. Then which of the sorting method will be most efficient to sort the new sequence?

Questions by mansinghhansda   answers by mansinghhansda

Showing Answers 1 - 9 of 9 Answers

abhimanipal

  • Jan 15th, 2010
 

The insertion sort method could be used. The algorithm will compare the extra entry with each element in the array to find its right position and then it will insert the extra element there.

The run time for this will be O(n)

I think radix sorting would be more perfect in case of large sequence of elements as because it will reduce the no. of elements to be compared to a minimal. As it goes on to check the inserted element wid the center of the sequence and rules out the half part of the sequence which is greater or smaller and then again it works in the similar way till we get the exact position for the inserted element.

  Was this answer useful?  Yes

netsim

  • Jul 9th, 2010
 

It depends on the date struct to store the sequence.
The answer for array or linked list will be different.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions