0 votes 0 votes In https://gateoverflow.in/343341/Gate-overflow-data-structures-1-11 Suppose $L$ is : 10 → 50 → 20 → 40 → 30 & $K$ is : 4, 1, 5 Wouldn’t the explained algorithm print values: 10 40 30 instead of 40 10 30? Won’t it require an algorithm that searches $L$ one by one for all values of $K$ in $O(nk)$ ? Algorithms gateoverflow test-series algorithms + – o asked Jan 31, 2022 • recategorized Feb 22, 2022 by Lakshman Bhaiya o 283 views answer comment Share Follow See 1 comment See all 1 1 comment reply palashbehra5 commented Jan 31, 2022 reply Follow Share the order is not really a concern here. 1 votes 1 votes Please log in or register to add a comment.