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
+1 vote
3.9k views
in Computer by (49.9k points)
closed by

The following function is a part of some class. It sorts the array a[ ] in ascending order using insertion sort technique. There are some places in the code marked by ?1?, ?2?, ?3?, ?4?, ?5? which must be replaced by expression / statement so that the function works correctly

void insertsort (int a [ ]) 

int m = ?1?; 

int b, i, t; for (i = ?2? ; i < m; i++) 

t = a[i]; 

b = i - I; 

while (?3? > = 0 && t < a [ b ]) 

{ a[b+1] = a[b]; ?4?; 

} ?5? = t; 

}

}

(i) What is the expression or statement at ?1?

(ii) What is the expression or statement at ?2? 

(iii) What is the expression or statement at ?3? 

(iv) What is the expression or statement at ?4?

(v) What is the expression or statement at ?5?

1 Answer

+2 votes
by (48.9k points)
selected by
 
Best answer

(i) a length 

(ii) 1 

(iii) b 

(iv) b = b – 1; 

(v) a[b+1]

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.

Categories

...