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:
Explanation:what is it about
Social Stratification it is mainly arrange into three components: upper magnificence, middle elegance and lower magnificence on the idea of energy and wealth. This has resulted in the creation of a number of levels within our society. It is bad because people in the community should give everybody access to prosperity on an equal basis. As disparities cause the downfall of countries, we must get united, as they say: united we stand, divided us fall. So, the rich people getting richer, poor people getting poorer.
It is important to have goals in life because, without them you cannot be leaded to what you want to do with your life. It is also important to have goals in life so you can challenge yourself to be better than what you are. Another reason for having goals would be just to be guided by them. HOPE THIS HELPS!!!