Two Dimensional Arrays
- Mapping
- Searching (all techniques)
- Sorting (all techniques)
- Hashing
- Diagonal matrix
- Lower triangular Matrix
- Upper triangular Matrix
- Symmetric Matrix
- Tridiagonal Matrix
The Code File is basically written in C++ and consists of code to map the content of 2D array into 1D array.
Two dimensional array is an array within an array. It is an array of arrays. In this type of array the position of an data element is referred by two indices instead of one.
Arrays have only one dimension, a row of elements while a matrix has more dimensions, mostly 2 but can have more than that, and its elements are either column or row arrays which are here called vectors for a matrix with two dimensions or matrices with dimension n-1 for a matrix of n dimensions.
Searching involves deciding whether a search key is present in the data. For example, looking up a phone book or address book. The searching algorithm includes:
The worst-case and average-case time complexity is O(n). The best-case is O(1).
The worst-case and average-case time complexity for binary search is O(log n). The best-case is O(1).
Sorting involves arranging data in ascending or descending order, according to a certain collating sequence (or sorting sequence). The sorting algorithm includes:
The average-case and worst-case time complexity is O(n2).
The average-case and worst-case time complexity is O(n2).
The average-case and worst-case time complexity is O(n2).
The worst-case and average-case time complexity is O(n log n). The best-case is typically O(n log n). However, merge sort requires a space complexity of O(n) for carrying out the merge-sorting.
The worst-case time complexity is O(n2). The average-case (typical) and best-case is O(n log n). In-place sorting can be achieved without additional space requirement.
Will Continue Adding. Himanshu Tiwari