Write a pseudo code for sorting the numbers in an array?
Answers were Sorted based on User's Feedback
Answer / prabhath
SelectionSort(A)
for i <- length[A]-1 downto 0
for j <- 0 to i
if (A[j]>MAX) // for descending, change this to MIN
MAX=A[j]
MAX_ID=j
temp=A[i]
A[i]=A[MAX_ID]
A[MAX_ID]=temp
Slow motion run of Selection Sort (Bold == sorted region):
5 1 3 2 4
4 1 3 2 5
1 3 2 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5 >> done
| Is This Answer Correct ? | 22 Yes | 14 No |
What is threshold voltage?
What are the total number of lines written by you in C/C++? What compiler was used?
Differences between Signals and Variables in VHDL? If the same code is written using Signals and Variables what does it synthesize to?
For CMOS logic, give the various techniques you know to minimize power consumption
Explain the Charge Sharing problem while sampling data from a Bus?
Explain the working of Insights of a pass gate ?
Explain how binary number can give a signal or convert into a digital signal?
Explain how logical gates are controlled by Boolean logic?
How do you size NMOS and PMOS transistors to increase the threshold voltage?
Why is Extraction performed?
Explain why is the number of gate inputs to cmos gates usually limited to four?
What are the Factors affecting Power Consumption on a chip?