Skip to content

Hsien-HsiuLiao/data-structures-and-algorithms-study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 

Repository files navigation

data-structures-and-algorithms-study

  1. Don’t spend too much time on the prep work.
  2. Don’t spend too little time on the prep work.

If you spend too much time studying, you’ll never get to solve Leetcode/CTCI problems. Conversely, you’ll be lost if you spend too little time on the prep work. It is important that you spend the right amount of time for the prep work to make sure that you do not waste your time.

Data Structures

https://medium.com/siliconwat/data-structures-in-javascript-1b9aed0ea17c -At a high level, there are basically three types of data structures.

  • Stacks and Queues are array-like structures that differ only in how items are inserted and removed.
  • Linked Lists, Trees, and Graphs are structures with nodes that keep references to other nodes.
  • Hash Tables depend on hash functions to save and locate data.

Algorithms

Prep work

Once you are comfortable with the data structures & algorithms above, do the following exercise multiple times (at least 2–3 times) until you can do them with your eyes closed.

  • Implement an ArrayList from scratch
  • Reverse a linked list
  • Implement a Stack & a Queue using Array
  • Implement a HashTable with simple Hashing functions
  • Implement a Graph using Adjacency List, and then write functions for BFS & DFS.
  • Write the binary search algorithm both recursively and iteratively
  • Write the merge sort algorithm
  • Write the quicksort algorithm
  • Print binary tree using DFS (in-order, preorder and post order — all three of them) and BFS.
  • Memorize time & space complexities for common algorithms. Here’s an interesting website.
  • Implement a trie.
  • Learn these important bit manipulation tricks. https://www.geeksforgeeks.org/bit-tricks-competitive-programming/

Resources

leetcode videos

practice

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published