Queue can be used to implement ?
Queue can be used to implement heap sort..not for quick sort.this is implemented by stack
Abdelrahman S. Fathy from Cairo, Egypt is saying merge sort is correct answer
Sanju Rebel from Hyderabad, India is saying merge sort is correct answer
esraa nashat from Cairo, Egypt is saying insertion sort is correct answer
Serkie Mekonnen from Dessie, Ethiopia is saying insertion sort is correct answer
Given two sorted lists of size m and n respectively.The number of comparisons needed in the worst case by the merge sort algorithm will be?
- [A] mn
- [B] max(m,n)
- [C] min(m,n)
- [D] m+n-1
The following sequence of operation is performed on stack : push(1),push(2),pop,push(1),push(2),pop,pop,pop,push(2),pop. The sequence of popped out values are ?
- [A] 2,2,1,1,2
- [B] 2,2,1,2,2
- [C] 2,1,2,2,1
- [D] 2,1,2,2,2
- [A] 16
- [B] 12
- [C] 6
- [D] 10