Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
457 views
in Arrays by (29.8k points)
closed by

In School Assembly, try to arrange all the students in your class according to the increasing order of their heights separately for male/female students. Smallest one will be in front and tallest one at the last position. Write sequential steps for doing this, in two different methods.

1 Answer

+1 vote
by (29.6k points)
selected by
 
Best answer

Arranging elements from smallest to largest (ascending) or largest to smallest(descending) is called sorting. 

There are two sorting methods 

1. Bubble sort: 

It is a simple sorting method. In this sorting considering two adjacent elements if it is out of order, the elements are interchanged. After the first iteration the largest(in the case of ascending sorting) or smallest(in the case of descending sorting) will be the end of the array. This process continues.

 2. Selection sort:

In selection sort the array is divided into two parts, the sorted part and unsorted part. First smallest element in the unsorted part is searched and exchanged with the first element. Now there is 2 parts sorted part and unsorted part. This process continues.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...