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 |
Insights of a pass gate. Explain the working?
what is verilog?
what is Latch up?How to avoid Latch up?
What is validation?
Describe the various effects of scaling?
What types of high speed CMOS circuits have you designed?
Give various factors on which threshold voltage depends.
What does the above code synthesize to?
Explain Clock Skew?
Implement a 2 I/P and gate using Tran gates?
Differences between DRAM and SRAM?
14 Answers Infosys, Intel, University, Wipro,
What is Fermi level?