📓
Algorithms
  • Introduction to Data Structures & Algorithms with Leetcode
  • Strings
    • Dutch Flags Problem
      • List Partitoning
    • Counters
      • Majority Vote
      • Removing Parentheses
      • Remove Duplicates from Sorted Array
    • Maths
      • Lone Integer
      • Pigeonhole
      • Check If N and Its Double Exist
      • Find Numbers with Even Number of Digits
    • Two Pointers
      • Remove Element
      • Replace Elements with Greatest Element on Right Side
      • Valid Mountain Array
      • Sort Array by Parity
      • Squares of a Sorted Array
      • Max Consecutive Ones
    • Sliding Window
      • Max Consecutive Ones 3
    • Stacks
      • Balanced Brackets
    • General Strings & Arrays
      • Move Zeros
      • Unique Elements
      • Merge Sorted Array
    • Matrices
      • Valid Square
      • Matrix Search Sequel
  • Trees
    • Untitled
  • Recursion
    • Introduction
    • Backtracking
      • Permutations
  • Dynamic Programming
    • Introduction
    • Minimum (Maximum) Path to Reach a Target
      • Min Cost Climbing Stairs
      • Coin Change
      • Minimum Path Sum
      • Triangle
      • Minimum Cost to Move Chips to The Same Position
      • Consecutive Characters
      • Perfect Squares
    • Distinct Ways
      • Climbing Stairs
      • Unique Paths
      • Number of Dice Rolls with Target Sum
    • Merging Intervals
      • Minimum Cost Tree From Leaf Values
    • DP on Strings
      • Levenshtein Distance
      • Longest Common Subsequence
  • Binary Search
    • Introduction
      • First Bad Version
      • Sqrt(x)
      • Search Insert Position
    • Advanced
      • KoKo Eating Banana
      • Capacity to Ship Packages within D Days
      • Minimum Number of Days to Make m Bouquets
      • Split array largest sum
      • Minimum Number of Days to Make m Bouquets
      • Koko Eating Bananas
      • Find K-th Smallest Pair Distance
      • Ugly Number 3
      • Find the Smallest Divisor Given a Threshold
      • Kth smallest number in multiplication table
  • Graphs
    • Binary Trees
      • Merging Binary Trees
      • Binary Tree Preorder Traversal
      • Binary Tree Postorder Traversal
      • Binary Tree Level Order Traversal
      • Binary Tree Inorder Traversal
      • Symmetric Tree
      • Populating Next Right Pointers in Each Node
      • Populating Next Right Pointers in Each Node II
      • 106. Construct Binary Tree from Inorder and Postorder Traversal
      • Serialise and Deserialise a Linked List
      • Maximum Depth of Binary Tree
      • Lowest Common Ancestor of a Binary Tree
    • n-ary Trees
      • Untitled
      • Minimum Height Trees
    • Binary Search Trees
      • Counting Maximal Value Roots in Binary Tree
      • Count BST nodes in a range
      • Invert a Binary Tree
      • Maximum Difference Between Node and Ancestor
      • Binary Tree Tilt
  • Practice
  • Linked Lists
    • What is a Linked List?
    • Add Two Numbers
      • Add Two Numbers 2
    • Reverse a Linked List
    • Tortoise & Hare Algorithm
      • Middle of the Linked List
  • Bitshifting
    • Introduction
  • Not Done Yet
    • Uncompleted
    • Minimum Cost For Tickets
    • Minimum Falling Path Sum
Powered by GitBook
On this page
  • Resources
  • How to contribute
  • Why Leetcode and not X, Y, Z platform?
  • Important Notes

Was this helpful?

Introduction to Data Structures & Algorithms with Leetcode

NextDutch Flags Problem

Last updated 4 years ago

Was this helpful?

You can read this here

GitHub repo is here:

What you need to know

  • Learn data structures & algorithms (DS&A) using leetcode

  • Only learn DS&A that is used in real world

  • Learn why it works, not just how.

  • Sorted by how likely it is to show up in an interview and how vital that knowledge is to understanding other DS&A.

  • The problems are mostly medium - hards, I try to not include easy problems unless they are the first problem in a category.

This is a course on datastructures and algorithms based around leetcode problems. Learn DS&A via problems, with lengthy explanations.

This guide is ordered by how likely it is for that datastructure / algorithm to show up in an interview and how vital that knowledge is to understanding other data structures / algorithms.

Each section will lead with a leetcode style problem, and end with problems you can do on your own. This way, you only ever learn what is relevant.

All code will be in Python due to how easy it is to read. If you want to contribute more code, feel free to. This is on GitHub after all!

Resources

You should roughly know these things. I have linked to some of my own resources for you to learn them:

For other resources you should see:

  • CTCI

  • MIT 6.006

How to contribute

  • Explain things more easily

  • Look through my Not Done Yet section and complete / improve them!

Why Leetcode and not X, Y, Z platform?

  1. Everyone knows Leetcode

  2. Leetcode discussion board is popping, and there's many Youtube videos about each platform

  3. AlgoExpert is not paying me to tell you that the scariest thing in the world is not knowing how to invert a binary tree in a coding interview yet.

  4. HackerRank's problems are too wordy for me to copy & paste.

  5. Companies use Leetcode

  6. Honestly if any other coding company came along and paid me to advertise their product I would it's just I used Leetcode. Deciding on what the best platform to use is another form of procrastination. I just picked the first one I saw and went with it.

Important Notes

  • Not all solutions are made by me (bee-san). This book is 100% open source and sometimes people on Leetcode forums have way bettter solutions than I do.

Welcome to Bee's guide to datastructures and algorithms! This is based on

If you're okay with Python, but want to learn the advanced stuff check out my other book

I also have my own blog, that you may enjoy.

(Not an expert, you can use other languages or contribute more languages)

(not an expert, just the basics)

https://github.com/guyinatuxedo/nightmare
https://github.com/bee-san/Python-Zero-to-Hero
https://skerritt.blog
Python
Big O notation
https://beesec.gitbook.io/algorithms/
https://github.com/bee-san/Algorithms
Introduction to Data Structures & Algorithms with LeetcodeAlgorithms
Logo