Exercise Questions on 1D-Array
- Input 10 number and find sum and average.
- Find maximum and minimum number in an array
- Find 2nd largest and 2nd smallest number in an array
- Merge 2 arrays in a sorted order
- Input 10 numbers in array and reverse the array list without using another array.
- Merge 2 arrays uniquely
- Append, Insert, Search, Reverse, Sort, Update, Delete an element in an array
- WAP that splits an array into odd and even numbers.
- Calculate sum of odd and even numbers
- Find factorial of each number stored in array
Sorting
Sorting is use to arrange the data in a particular order, either ascending or descending order.
Types of Sort:
- Bubble Sort - it start comparing number from start till bottom and place a largest number in the end.
- Selection Sort - It starts comparing number from top and place a smallest number in starting.
- Insertion - Insertion sort start comparing number from 1st index to top of the list and insert that number at its sorted position.
Exercise Question on 2D-Array
- Input two 3x3 matrix and add them.
- Input two 3x3 matrix and multiple them.
- Input 3x3 matrix and transpose it.
- Input 3x3 matrix and find sum of all rows, columns and diagonals
- Find whether the input matrix is symmetric or not.
- Find the upper and lower triangular matrices.