> 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
>
After this step, according to your second step, you will insert 3 in queue
first. Why have u inserted 5 here?

> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

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

Reply via email to