https://github.com/3ein39/sparse_array_matrix
Representing an array of very huge indices (e.g. 10^8) using doubly linked list
https://github.com/3ein39/sparse_array_matrix
data-structures doubly-linked-list linked-list sparse-matrices sparse-matrix
Last synced: 8 months ago
JSON representation
Representing an array of very huge indices (e.g. 10^8) using doubly linked list
- Host: GitHub
- URL: https://github.com/3ein39/sparse_array_matrix
- Owner: 3ein39
- Created: 2022-08-27T17:36:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-30T18:16:52.000Z (over 3 years ago)
- Last Synced: 2025-02-28T04:58:21.828Z (about 1 year ago)
- Topics: data-structures, doubly-linked-list, linked-list, sparse-matrices, sparse-matrix
- Language: C++
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [Sparse 1D Array](https://github.com/3ein39/Sparce_Array_Matrix/blob/main/1d_sparce.cpp)
Representing an array of very huge indicies (e.g. 10^8) using doubly linked list ..
- In some applications, we might want to represent an array with indices very huge (e.g. 10^8), however, most of it are just zeros (e.g. 95%).
- Creating such huge arrays is very time & memory harmful with no return.
* The following functions are supported :
- Set & Get positions.
- Print & Add arrays.
---
# [SparseMatrix (2D Array)](https://github.com/3ein39/Sparce_Array_Matrix/blob/main/2d_sparce.cpp)
A more severe/common case is a sparse matrix where most of it are zeros which is implemented here.
- Similarly, SparseMatrix acts like a 2D array.
* Now we can think of sparse matrix as linked list of linked list
- 2 linked lists.
- First: the 1D array linked list
- Second: linked list, the data of each node is a 1D linked list
- Again .. A double ll is used.
## Acknowledgements
- [Mastering critical SKILLS in Data Structures using C++](https://www.udemy.com/course/dscpp-skills/)