Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a pseudo code for sorting the numbers in an array?

Answers were Sorted based on User's Feedback



Write a pseudo code for sorting the numbers in an array?..

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

Write a pseudo code for sorting the numbers in an array?..

Answer / vicneswary

5 1 3 2 4
1 3 5 2 4
1 2 3 5 4
1 2 3 4 5

Is This Answer Correct ?    3 Yes 8 No

Post New Answer

More VLSI Interview Questions

What are the different design techniques required to create a layout for digital circuits?

0 Answers  


What is the mealy and moore machine's state diagram that can detect 3 consecutive heads of 3 coins ?

2 Answers  


What are the Factors affecting Power Consumption on a chip?

0 Answers   Intel,


What was your role in the silicon evaluation or product ramp? What tools did you use?

0 Answers   Intel,


Advantages and disadvantages of Mealy and Moore?

2 Answers   Intel,


Factors affecting Power Consumption on a chip?

7 Answers   Intel,


Draw a transistor level two input NAND gate. Explain its sizing (a) considering Vth (b) for equal rise and fall times

0 Answers   Infosys,


Explain sizing of the inverter?

0 Answers   Infosys,


What are the different measures that are required to achieve the design for better yield?

0 Answers  


Explain why & how a MOSFET works?

2 Answers   Infosys,


For f = AB+CD if B is S-a-1, what are the test vectors needed to detect the fault?

0 Answers   Intel,


What is the difference between fifo and the memory?

6 Answers   DewSoft, Intel, Pentagon Rugged Systems,


Categories