- Remove duplicate elements from an unsorted linked list
- http://www.geeksforgeeks.org/sort-a-linked-list-of-0s-1s-or-2s/ - Here you are counting and doing it. However, you might have to do it in O(n). In that case, keep three pointers and keep assigning the nodes to the pointers. Keep track of edge cases 000, 111, 222,0,1,2,00111,0022.
- http://www.geeksforgeeks.org/reverse-a-list-in-groups-of-given-size/ : In order to solve this problem, first solve reverse a linked list recursively. Then, you can use that recursive solution here. Solved it well during practice. However, remember the code to reverse a linked list should be learnt by heart.
- http://www.geeksforgeeks.org/write-a-function-to-reverse-the-nodes-of-a-linked-list/
- http://www.geeksforgeeks.org/reverse-a-doubly-linked-list/ - reverse a doubly linked list by heart.
Apart from coding and design interview questions, this page contains updates on my learnings with Java. It helps me organize my learning. Read about my future self here : https://siliconvalleystories.blogspot.com/
Monday, 3 December 2012
A comprehensive list of Linked List interview questions
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment