Create a temp array temp[0..k-1] of size k.
2) Traverse the array arr[k..n-1]. While traversing, keep updating the
smallest element of temp[]
3) Return the smallest of temp[]
Time Complexity: O((n-k)*k).


try it ..............for this problem[?]

-- 
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.

<<338.gif>>

Reply via email to