Close

Finding two numbers occuring once

Given an array containing all elements twice except two numbers. Write a program to find those two numbers. For example let us consider the following array {2, 3, 2, 1, 4, 1, 4, 5} The answer is {3,5} because they appear only once and all remaining elements appear twice. This question is somewhat similar to earlier…

Merging k sorted lists

Given K sorted lists, how to merge them into a single sorted list? Let total number of elements in K sorted lists is N. We have to form a single sorted list of length N. For example let us consider the following input lists{4, 19, 27}{1, 6, 50, 73}{9, 45, 59, 67} The output should…