Skip to main content

LinkedList Interview Questions


1) Print Elements of Linked List


2) Reverse LinkedList



3) Delete a given Element of a LinkedList



4) Delete kth Element from headNode of  a LinkedList



5) Delete kth Element from tailNode of  a LinkedList



6) Detect if a LinkedList contains a Cycle



7) Remove an Element from a DoublyLinkedList



8) Merge Elements of a DoublyLinkedList



9) Create a Cache such that the Elements can be added at Head and removed from Tail, in O(1)



10) Merge K Sorted Lists

K Sorted Linked Lists cab be merged using MinHeap. All the elements from all the K Linked Lists are added to the MinHeap one by one. Create a Dummy LinkedList Node and add all the nodes from the Min Heap to the LinkedList node. Return the Next Node of the dummy Node which becomes the head for the combined LinkedList.


Comments

Popular posts from this blog

Java Productivity tools

Here are the list of Java Productivity tools that help in simplifying the daily life of a developer. Eclipse as an IDE simplifies the development life cycle which has a lots of plugins to support different programming languages and frameworks. Some of useful Eclipse plugins are - Sonarlint that helps to do static code analysis and give suggestions as we go along the development life cycle. JDGUI - Is the Eclipse Plugin that supports the decompilation of the Java application within eclipse, this is very handy when debugging and need to look at the out of the box code from a framework/library. JUnit is the unit testing framework that supports Unit Testing of Java Applications. Mockito is the framework that supports the Mock Unit Testing of the Java Application.