Question
5,1,4,2,8 how many more pass are needed to finish
sorting by bubble sorting technique?Solution
First Pass: ( 5 1 4 2 8 ) –> ( 1 5 4 2 8 ), Here, algorithm compares the first two elements, and swaps since 5 > 1. ( 1 5 4 2 8 ) –> ( 1 4 5 2 8 ), Swap since 5 > 4 ( 1 4 5 2 8 ) –> ( 1 4 2 5 8 ), Swap since 5 > 2 ( 1 4 2 5 8 ) –> ( 1 4 2 5 8 ), Now, since these elements are already in order (8 > 5), algorithm does not swap them. Second Pass: ( 1 4 2 5 8 ) –> ( 1 4 2 5 8 ) ( 1 4 2 5 8 ) –> ( 1 2 4 5 8 ), Swap since 4 > 2 ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 ) Now, the array is already sorted, but our algorithm does not know if it is completed. The algorithm needs one whole pass without any swap to know it is sorted. Third Pass: ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 ) ( 1 2 4 5 8 ) –> ( 1 2 4 5 8 )
Which among the following word cannot be formed using the letters of the given word only once?
ONDANSETRON
From the given options, select the word which cannot be formed using the letters of the word 'ADVERTISEMENT' only once.
In the following question, a group of letters is given which are numbered 1, 2, 3, 4, 5 and 6. Below are given four alternatives containing combinatio...
Which among the following words cannot be formed using the letters of the given word only once?
CONFIRMATIONFind which one of the given words can be made from the letters of the given word.
‘ SMARTLY ’
...Which of the following words can be formed using the letters of the word only once?
TRANSFORMER
Word I: FORMAT
Word II: REFORM
Word III: REMOTE
If it is possible to make a meaningful word with the second, fourth, fifth, and eighth letters of the word ‘ACHIEVED’, then which of the following w...
How many meaningful words (more than 3 letters) can be formed using the letters of the given word 'DESIGNATION' ?
From the given alternatives select the word which cannot be formed using the letters of the given word
SECULARIZATION
Which among the following words cannot be formed using the letters of the given word only once?
DETERMINATION