Skip to content

initialed85/data-structures-and-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures and Algorithms

It's time.

Goal

I struggled with LeetCode - Meeting Rooms III; I did eventually get it to be performant enough, but my solution was all wrong- apparently I needed to use two MinHeaps.

Which lead to the question, what the hell is a MinHeap?

So, in this repo, I'm gonna learn data structures and algorithms by implementing them and hoping that'll work.

Approach

I don't know exactly what to cover, but I've been watching some videos and doing some reading, so we'll do something like:

  • Array
    • Linear search to find element
    • Fixed length sliding window to find sequence of known length
    • Variable length sliding window to find longest sequence of repeating pattern
  • Hash Set (using builtins vs from scratch)
    • Remove duplicates from array
  • Hash Map (using builtins vs from scratch)
    • Count occurrence of strings in array
  • Linked List
    • Reverse a singly-linked list
    • Rotate a singly-linked list
    • Find the middle of linked list (two pointer technique)
    • Create a doubly-linked list
    • Create a stack from a doubly-linked list
    • Create a queue from a doubly-linked list
  • Binary Tree
    • Get deepest binary tree path (using a queue)
    • Get broadest binary tree level
    • Invert binary tree
  • Heap
    • Create a min heap
    • Create a max heap
    • Create a min priority queue
  • Problems
    1. Find longest substring without repeating characters (sliding window and hash set)
    2. Design a LRU cache (hash map and doubly linked list)
    3. Implement shortest path algorithm for a social network (graph traversal and Dijkstra's algorithm)

TODO

  • Rotate a binary tree?
  • Balance a binary tree?

About

Just trying to learn me some DSA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages