Skip to content

gtinside/algopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithms what else

Trees

  1. Invert Binary Tree. Trees/invert.py
  2. Maximum Depth. Tress/max-depth.py
  3. Balanced Binary Tree. Trees/balance-binary-trees.py
  4. Same Tree. Trees/same-tree.py
  5. LCA of BST. Trees/lca.py
  6. Level Order Traversal of a BST. Trees/level-order.py
  7. Right Side view. Trees/right-side-view.py
  8. Count Good Node. Trees/count-good-nodes.py
  9. Valid BST. Trees/valid-bst.py
  10. Kth smallest element. Trees/ksmallest-element.py
  11. Binary Tree from Inorder and Preorder traversal. Trees/inorder-preorder.py
  12. Binary Tree Maximum Path Sum. Trees/max-path-sum.py
  13. Serialize and Deserialize Binary Tree. Trees/ser-deser-btree.py

Graphs

  1. DFS. Graphs/dfs.py
  2. BFS. Graphs/bfs.py
  3. Number of provinces. Graphs/province.py
  4. Detect cycle in undirected graph. Graphs/cycle-undirected.py
  5. 01 Matrix. Graphs/01matrix.py
  6. Surrounded Regions. Graps/surrounded-regions.py
  7. Number of Enclaves. Graphs/num-of-enclaves.py
  8. Number of Islands. Graphs/num-of-islands.py
  9. Minimum Knight Moves. Graphs/min-knight-moves.py
  10. Minimum Height Trees. Graphs/min-height-trees.py

Dynamic Programming

  1. Longest Non-decreasing Subarray From Two Arrays. DP/non-decreasing-subarr.py
  2. Delete and Earn. DP/delete-and-earn.py
  3. Count Ways To Build Good Strings. DP/count-ways.py
  4. Knight Probability in Chessboard. DP/knight-probability.py
  5. Best Time to Buy and Sell Stock II. DP/best-time-buy-sell2.py
  6. House Robber. DP/house-robber.py

Arrays

  1. Minimum Equal Sum of Two Arrays After Replacing Zeros. Arrays/min-equal-sum.py
  2. Subarray Sums Divisible by K. Arrays/subarray-sum-divisible-by-k.py
  3. Find the Duplicate Number. Arrays/find-duplicate-number.py

Stack

  1. Evaluate Reverse Polish Notation. Stack/reverse-polish-notation.py
  2. Insert Delete GetRandom O(1).Stack/randomized-set.py

Linked List

  1. LRU Cache. LinkedLists/lru-cache.py
  2. LFU Cache. LinkedLists/lfu-cache.py

Backtracking

  1. N-Queens. Backtracking/nqueen.py

Sliding Window

  1. Sliding Window Maximum. Sliding Window/sliding-window-max.py

About

Implementation of popular leetcode questions in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages