Showing posts from May, 2013

Comparable and Comparator interface in Java

It is one of the popular interview question for Java developers, "What is difference between Comparable and Comparator" . Sometimes it is asked in different form, We have a list of Employee objects(with name, employeeId, salary) and we want …

Find middle node of a linked list

Problem statement :- Middle element of linked list can be at even or odd position(depending on length of linked list).If size of list is 2n, even no of elements, middle node is at position n+1 and if size of list is n,odd no of elements, then middle e…

Load More
That is All