1)Sort the first 10 elements (first window)
2)initialise i=1,l=j=10
3)last element is the maximum(l=10) printf(a[l])
4)i=i+1,j=j+1 if(a[j]>a[l])
     then printf(a[j])
     l=j
5)else printf(a[l])
6)if(i==l)
   repeat from step 1
for worst case it needs 10 sorts
Correct if i am wrong

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@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