Capability3 Assignment
Capability3 Assignment
Introduction:
This document covers list of assignments/exercises related to third capability of
Basecamp program:
Observations:
KO: 1. Ability to do a sort correctly with the given requirements - at least two sorting
techniques (preferably bubble and insertion sorting)
KO: 2. Ability to do a search correctly with the given requirements -using both linear and
binary search algorithms
3. Ability to do the same with increased complexity - Applying sorting and searching
algorithms for array of user defined objects
4. Ability to merge two different data sets - Merging two different arrays of primitive
elements
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1
Basecamp Capability 3 Assignments
2
Basecamp Capability 3 Assignments
Source: https://www.w3resource.com/java-exercises/sorting/java-sorting-algorithm-
exercise-7.php
Note:
- Assume array indexing starts from 0
3
Basecamp Capability 3 Assignments
- If array has any duplicate element then it should display error message and exit.
Input:
12345
4
Output:
3
Write a method to return the index of the maximum value between two given indexes in
a given array.
Input:
A[] = {2, -5, 10, 21, 30}
Index1 = 2
Index 2= 3
Output:
21
Note: If given index values are not in the valid range then program must through an
error and exit.
4
Basecamp Capability 3 Assignments
Given M sorted lists each containing N elements, print them in sorted order.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Summary:
You must have learnt following concepts:
How to work with sorting algorithms: Bubble and insertion sort
How to work with search algorithms: Linear and binary search
How apply sorting and searching algorithms for user defined objects?
How to merge multiple arrays based on business conditions?