Skip to content

sedo-swe/learnAlgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 

Repository files navigation

learnAlgo

  • Problems from leetcode, which picked by neetcode.io

Arrays & Hashing

    Easy
        217. Contains Duplicate (Insertion Sort Algorithm)
        242. Valid Anagram  (HashMap KeySet comparison)
        1. Two Sum
    Medium
        49. Group Anagrams
        238. Product of Array Except Self
        347. Top K Frequent Elements

Two Pointers

    Easy
        125. Valid Palindrome
    Medium
        86. Partition List (Linked List)
        167. Two Sum II - Input Array Is Sorted
        15. 3Sum

Sliding Window

https://builtin.com/data-science/sliding-window-algorithm

    Easy
        121. Best Time to Buy and Sell Stock
        MAXIMUM SUM SUBARRAY OF SIZE K
    Medium
        3. Longest Substring Without Repeating Characters
        424. Longest Repeating Character Replacement
        567. Permutation in String
        

Stack

    Easy
        20. Valid Parentheses
    Medium
        155. Min Stack

Binary Search

    Easy
        704. Binary Search
    Medium
        74. Search a 2D MatrixW
        33. Search in Rotated Sorted Array (Medium)

Linked List

    Easy
        21. Merge Two Sorted Lists
        206. Reverse Linked List (Iteration w/ stack, exchange, Recursive)
        141. Linked List Cycle (using two pointers, find cycle)
    
    Medium
        23. Merge k Sorted Lists
        143. Reorder List
        148. Sort List
        19. Remove Nth Node From End of List
        138. Copy List with Random Pointer
        2. Add Two Numbers
        287. Find the Duplicate Number (Medium): Use Cyclic sort

Trees

    Easy
        226. Invert Binary Tree (Using inorder traversal)
        104. Maximum Depth of Binary Tree
        543. Diameter of Binary Tree (Using HashMap for efficiency in Iteration model)
        110. Balanced Binary Tree (Using global variable)
        100. Same Tree
        572. Subtree fo Another Tree
        637. Average of Levels in Binary Tree (BFS / DFS)
        
    Medium
        235. Lowest Common Ancestor of a Binary Search Tree
        515. Find Largest Value in Each Tree Row
        1302. Deepest Leaves Sum
        102. Binary Tree Level Order Traversal : Tree level
        1448. Count Good Nodes in Binary Tree
        230. Kth Smallest Element in a BST --> Visiting in order BST would be ordered
        105. Construct Binary Tree from Preorder and Inorder Traversal

Tries

    Medium
        208. Implement Trie (Prefix Tree) -- using fixed size array to store strings

Heap / Priority Queue

    Easy
        703. Kth Largest Element in a Stream
        1046. Last Stone Weight
    Medium
        973. K Closest Points to Origin

Backtracking

    Easy
        257. Binary Tree Paths
    Medium
        78. Subsets
        39. Combination Sum -- Best for Backtracking

Graphs

    Medium
        200. Number of Islands -- BFS / DFS, Best for BFS / DFS
        133. Clone Graph
        Maze -- BFS / DFS

Advanced Graphs

    Medium
        1584. Min Cost to Connect All Points : using PriorityQueue and Set with Prim's algorithm
        743. Network Delay Time : Using Dijkstra
        87. Cheapest Flights Within K Stops : Using Bellman-Ford

1-D Dynamic Programming

    Easy
        70. Climbing Stairs
        746. Min Cost Climbing Stairs

    Medium        
        5. Longest Palindromic Substring

2-D Dynamic Programming

    Easy

Greedy

    Easy

Intervals

    Easy
        252. Meeting Rooms

Math & Geometry

    Easy
        202. Happy Number
        66. Plus One

Bit Manipulation

    Easy
        190. Reverse Bits
    Medium
        371. Sum of Two Integers : how to handle carry over with bit operation and shift

SortList : Find middle of linked list


* Must review before interview

    Easy
        637. Average of Levels in Binary Tree (BFS / DFS)
    Medium
        78. Subsets
        39. Combination Sum -- Best for Backtracking
        200. Number of Islands
        973. K Closest Points to Origin
        1584. Min Cost to Connect All Points -- Prim's algorithm
        1302. Deepest Leaves Sum -- Trees, how to distinguish levels in tree with BFS, DFS
        198. House Robber -- DP
        87. Cheapest Flights Within K Stops : Using Bellman-Ford

Readable

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages