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

If the current thru the poly is 20nA and the contact can take a max current of 10nA how would u overcome the problem?

1 Answers   Intel,


Implement a 2 I/P and gate using Tran gates?

0 Answers   Intel,


If not into production, how far did you follow the design and why did not you see it into production?

1 Answers   Intel,


What are the changes that are provided to meet design power targets?

0 Answers  


What happens to delay if we include a resistance at the output of a CMOS circuit?

1 Answers   Infosys,


Approximately, what were the sizes of your transistors in the SRAM cell? How did you arrive at those sizes?

0 Answers   Infosys,


Differences between Signals and Variables in VHDL? If the same code is written using Signals and Variables what does it synthesize to?

1 Answers   IIT, Intel,


Describe a finite state machine that will detect three consecutive coin tosses (of one coin) that results in heads.

0 Answers   Intel, Sun Microsystems,


What are the different gates where boolean logic are applicable?

0 Answers  


Explain Cross section of an NMOS transistor?

0 Answers   Intel,


Explain Basic Stuff related to Perl?

0 Answers   Intel,


Differences between DRAM and SRAM?

14 Answers   Infosys, Intel, University, Wipro,


Categories