Answer:
A Simple Solution is to sort the array in increasing order. The first two elements in sorted array would be two smallest elements. Time complexity of this solution is O(n Log n).
A Better Solution is to scan the array twice. In first traversal find the minimum element. Let this element be x. In second traversal, find the smallest element greater than x. Time complexity of this solution is O(n).
The above solution requires two traversals of input array.
An Efficient Solution can find the minimum two elements in one traversal. Below is complete algorithm.
Algorithm:
Explanation:
Answer:
Perhaps the decisive innovation was the invention in 1925 of the stern slipway for factory ships (Tonnessen and Johnsen 1982). This enabled whalers to haul animals on deck and process them without a land-based whaling station. Ships now flourished in the whale-rich pelagic areas of the Antarctic.
Explanation:
The fed is the correct answer
Answer:
what to find in this question.?