step:-
1) sort the array
2) remove the smallest and largest element from arary. keep the smallest
elemnt in seperate queue(result)
3) repeat the above untill the array is empty or it contains only it
contains only one element
4) put the last element also in the queue (result)


eg:-for ur example
sorted array wl be 2,3,5,,8,,10 result=empty
new sorted array=3,5,8 result=2
new sorted array=5 result 2,5
as it contains only 1 element so result=2,5,3

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to