Showing posts from February, 2014

Reverse a singly linked list in Java - Recursive and Iterative approach

Linked list reversal is common interview question. Linked list can be reverse in both iterative and recursive way. Recursive way is little bit difficult to code compare to iterative one.Iterative one is memory efficient when dealing with large number …

Find length of Linked list - Recursive and iterative approach

To find length of linked list is one of warm-up interview question. Idea here is to write sample program to find length of list using recursion, iterative way of finding is not a big deal(iterate linked list and maintains a counter & increment for…

Display linked list in reverse order in Java

In order to display linked list in reverse order we can use fundamental of recursion - call method recursively and display node while returning from where it was called. Sample code for displaying data in reverse order: private void displayLinked…

How generics works internally in java

Generics was added in java as part of JDK 5. It is one of the key area from where questions being asked at senior java developer level and expected to have solid understanding of generics fundamentals and its internal workings. The main agenda of this…

Load More
That is All