It is about implementation of a Sparse array and matrix (2D) which helps in saving memory and time espically when there is a lot of unused wasted memory.
It's a data structure used espacially when there is a lot of unused memory and some only is used which may not be avaliable all the time. So , I made a container which uses only the determined values saving the wasted memory and that is so useful espically in the polynomial functions. it is a good example for the problem and that data structure solves that problem.
- printing the array
- printing non zero elements in array
- adding two arrays
- setting values in the array
- getting values from the array
It's a datastructure and the mostly used in industry . the same idea saves a lot of memory of wasted unused spaces . but the key difference that one for a grid which have columns and rows. So , another one of the same problem in a differen way solved by that datastructure . to make that datastructure i have used the previous one and that make sense the idea differs because of the implementation of the functions differs.
- printing the 2D array
- printing the 2D array with non zero elements only
- adding two matrices
- setting values for the matrix
- getting values from the matrix by row and column