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 is verilog?
Differences between Array and Booth Multipliers?
What does it mean “the channel is pinched off”?
Give the logic expression for an AOI gate. Draw its transistor level equivalent. Draw its stick diagram
Explain Cross section of an NMOS transistor?
Approximately, what were the sizes of your transistors in the SRAM cell? How did you arrive at those sizes?
Process technology? What package was used and how did you model the package/system? What parasitic effects were considered?
What are the different design techniques required to create a layout for digital circuits?
How logical gates are controlled by boolean logic?
For a single computer processor computer system, what is the purpose of a processor cache and describe its operation?
For CMOS logic, give the various techniques you know to minimize power consumption
Explain how MOSFET works?
Mention what are the different gates where Boolean logic are applicable?
How does the size of PMOS Pull Up transistors (for bit & bit- lines) affect SRAM's performance?
why is the number of gate inputs to CMOS gates usually limited to four?