Professional Documents
Culture Documents
CO-Mapping
CO1 CO2 CO3 CO4
Q1 √ √
Q2 √ √
Q3 √ √
Objectives
1. Students will be able to learn linear search and binary search
2. Students will be able to learn different sorting techniques.
3. Students will learn binary search.
for (int j = 0; j < a.length - i; j++) { // skip the already sorted largest elements, compare to
a.length - 1
if (a[j] > a[j+1]) {
int temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
School of Computer Science Engineering and Technology
is_sorted = false;
}
}
if(is_sorted) return;
}
}
3. Write an iterative version of binary search with comments explaining the steps.