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 happens to delay if you increase load capacitance?

1 Answers   Google,


What products have you designed which have entered high volume production?

1 Answers   Intel,


what is verilog?

0 Answers  


How does Vbe and Ic change with temperature?

0 Answers   Qualcomm,


what is the use of defpararm?

0 Answers  


Draw the stick diagram of a NOR gate. Optimize it

0 Answers   Infosys,


What are the limitations in increasing the power supply to reduce delay?

2 Answers   Infosys,


What products have you designed which have entered high volume production?

0 Answers   Intel,


What are the different design constraints occur in the synthesis phase?

0 Answers  


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

0 Answers  


what is Early effects and their physical origin.

1 Answers  


What is Noise Margin? Explain the procedure to determine Noise Margin?

4 Answers   Amkor, Cisco, Infosys, Intel,


Categories