A curated collection of essential data structures implemented in Dart with clean code and real-world use cases.
This repository provides a collection of fundamental data structures implemented in Dart, including detailed explanations, usage examples, and performance insights.
It's perfect for:
- Dart & Flutter developers learning algorithms.
- Students preparing for technical interviews.
- Anyone wanting to understand how data works under the hood in Dart.
Category | Structures |
---|---|
Linear | ✅ Lists, ✅ Linked Lists, ✅ Stacks, ✅ Queues |
Non-linear | ✅ Trees, ✅ Graphs |
Hashing | ✅ Hash Tables, ✅ Sets |
Advanced | ⏳ Tries, ⏳ Heaps, ⏳ Priority Queues |
Utilities | ✅ Custom Iterators, ✅ Comparators |
data_structures_dart/
│
├── lib/
│ ├── arrays/
│ ├── linked_list/
│ ├── stack/
│ ├── queue/
│ ├── tree/
│ ├── graph/
│ └── hash_table/
│
├── test/
│ └── unit_tests_for_all_structures.dart
│
└── README.md
- Clone the repository
git clone https://github.com/amrnabih113/data_structures_dart.git
cd data_structures_dart
- Run tests
dart test
- Explore the code
- Each file is well-commented.
- You’ll find
main()
functions for demo purposes.
class Stack<T> {
final _list = <T>[];
void push(T value) => _list.add(value);
T pop() => _list.removeLast();
T get top => _list.last;
bool get isEmpty => _list.isEmpty;
}
Structure | Access | Search | Insertion | Deletion |
---|---|---|---|---|
Array | O(1) | O(n) | O(n) | O(n) |
Linked List | O(n) | O(n) | O(1) | O(1) |
Hash Table | — | O(1) | O(1) | O(1) |
Stack/Queue | — | O(n) | O(1) | O(1) |
Amr Mohamed Nabih
- 👥 GitHub
- 📧 [email protected]
If you find this useful, please consider starring ⭐ it — it helps others discover this work and supports open learning.
Let’s build a smarter world, one data structure at a time.