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 are the different design techniques required to create a layout for digital circuits?
What is the mealy and moore machine's state diagram that can detect 3 consecutive heads of 3 coins ?
What are the Factors affecting Power Consumption on a chip?
What was your role in the silicon evaluation or product ramp? What tools did you use?
Advantages and disadvantages of Mealy and Moore?
Factors affecting Power Consumption on a chip?
Draw a transistor level two input NAND gate. Explain its sizing (a) considering Vth (b) for equal rise and fall times
Explain sizing of the inverter?
What are the different measures that are required to achieve the design for better yield?
Explain why & how a MOSFET works?
For f = AB+CD if B is S-a-1, what are the test vectors needed to detect the fault?
What is the difference between fifo and the memory?
6 Answers DewSoft, Intel, Pentagon Rugged Systems,