We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
well I tried to learn more about it and it says that pop operation on any arbitrary value is O(n) while if it is performed on the last element it is O(1). So is the time complexity for the pop operation different when performed on the first element of the queue ? . I am confused... do let me know what you think ?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Level Order Traversal
You are viewing a single comment's thread. Return to all comments →
well I tried to learn more about it and it says that pop operation on any arbitrary value is O(n) while if it is performed on the last element it is O(1). So is the time complexity for the pop operation different when performed on the first element of the queue ? . I am confused... do let me know what you think ?