Skip to content

mlarocca/grokking_data_structures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grokking Data Structures

Grokking Data Structures

To Run All Tests:

From the ./python folder, run

python -m unittest tests/test_*

Note on Python

The code in the book also doesn’t have type hints, which you can find instead in the version hosted here on GitHub. This decision was made to reduce code clutter and to avoid additional cognitive load for beginners who may not be familiar with type hints in Python. Similarly, the book doesn't include tests.

However, in this repository you have the chance to find the full code with type hints, and tests.

Introduction

Data structures vignette

Static (Unsorted) Arrays

Arrays in memory

Run Tests:

From the ./python folder, run

python -m unittest tests/test_unsorted_array.py

Sorted Arrays

Binary search

Run Tests:

From the ./python folder, run

python -m unittest tests/test_sorted_array.py

Big-O Notation

Big-O notation and the real world

Dynamic Arrays

Doubling strategy to grow a dynamic array

Run Tests:

From the ./python folder, run

python -m unittest tests/test_dynamic_array.py

Linked Lists

Singly-Linked Lists | Python |

Singly-linked list

Run Tests:

From the ./python folder, run

python -m unittest tests/test_singly_linked_list.py

Sorted Singly-Linked Lists | Python |

Insertion in a sorted singly-linked list

Run Tests:

From the ./python folder, run

python -m unittest tests/test_sorted_singly_linked_list.py

Doubly-Linked Lists | Python |

A node of a doubly-linked list

Run Tests:

From the ./python folder, run

python -m unittest tests/test_doubly_linked_list.py

Bags

Bag data structure

Run Tests:

From the ./python folder, run

python -m unittest tests/test_bag.py

Stacks

A Stack in action

Run Tests:

From the ./python folder, run

python -m unittest tests/test_stack.py

Queues

A Queue in action

Run Tests:

From the ./python folder, run

python -m unittest tests/test_queue.py

Priority queues and heaps

A heap

Run Tests:

From the ./python folder, run

python -m unittest tests/test_heap.py

Binary search trees

A generic tree

Run Tests:

From the ./python folder, run

python -m unittest tests/test_bst.py

Dictionaries and hash tables

From object to hash

Run Tests:

From the ./python folder, run

python -m unittest tests/test_hash_table.py

Graphs

An undirected graph

Run Tests:

From the ./python folder, run

python -m unittest tests/test_graph.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages