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 happens to delay if you increase load capacitance?
What products have you designed which have entered high volume production?
what is verilog?
How does Vbe and Ic change with temperature?
what is the use of defpararm?
Draw the stick diagram of a NOR gate. Optimize it
What are the limitations in increasing the power supply to reduce delay?
What products have you designed which have entered high volume production?
What are the different design constraints occur in the synthesis phase?
What are the different design techniques required to create a layout for digital circuits?
what is Early effects and their physical origin.
What is Noise Margin? Explain the procedure to determine Noise Margin?
4 Answers Amkor, Cisco, Infosys, Intel,