Write a pseudo code for sorting the numbers in an array?
Answer Posted / 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 |
Post New Answer View All Answers
What are the main issues associated with multiprocessor caches and how might you solve them?
Draw the stick diagram of a NOR gate. Optimize it
Give a big picture of the entire SRAM Layout showing your placements of SRAM Cells, Row Decoders, Column Decoders, Read Circuit, Write Circuit and Buffers
Explain about 6-T XOR gate?
why is the number of gate inputs to CMOS gates usually limited to four?
Mention what are the different gates where Boolean logic are applicable?
What is Body Effect?
Calculate rise delay of a 3-input NAND gate driving a 3-input NOR gate through a 6mm long and 0.45m wide metal wire with sheet resistance R = 0.065 / and Cpermicron= 0.25 fF/m. The resistance and capacitance of the unit NMOS are 6.5k and 2.5fF. Use a 3 segment -model for the wire. Consider PMOS and NMOS size of reference inverter as 2 and 1 respectively. Use appropriate sizing for the NAND and NOR gate.
what is multiplexer?
For CMOS logic, give the various techniques you know to minimize power consumption
Describe the various effects of scaling?
what is a sequential circuit?
Explain the working of Insights of a pass gate ?
How does Vbe and Ic change with temperature?
What are the steps involved in designing an optimal pad ring?