Skip to content

xiaohai0520/Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leetcode.jpeg

Travis Travis Travis

简体中文 | English

介绍

本仓库目前分为两个部分:



算法与数据结构

只有熟练掌握基础的数据结构与算法,才能对复杂问题迎刃有余。

算法:

数据结构:

  • 数组与链表:单 / 双向链表
  • 栈与队列
  • 哈希表
  • 堆:最大堆 / 最小堆
  • 树与图:最近公共祖先、并查集
  • 字符串:前缀树(字典树) / 后缀树

LeetCode题目

##【153/1000】

# Title Solution Difficulty Topic
1 Two Sum Python Easy Array
2 Add Two Numbers Python Medium LinkedList
3 Longest Substring Without Repeating Characters Python Medium Sliding Window
94 Binary Tree Inorder Traversal Python Hard Tree
95 Unique Binary Search Trees II Python Medium Tree
96 Unique Binary Search Trees Python Medium Tree
98 Validate Binary Search Tree Python Medium Tree
99 Recover Binary Search Tree Python Hard Tree
100 Same Tree Python Hard Tree
101 Symmetric Tree Python Easy Tree
102 Binary Tree Level Order Traversal Python Medium Tree
103 Binary Tree Zigzag Level Order Traversal Python Medium Tree
104 Maximum Depth of Binary Tree Python Easy Tree
105 Construct Binary Tree from Preorder and Inorder Traversal Python Medium Tree
106 Construct Binary Tree from Inorder and Postorder Traversal Python Medium Tree
107 Binary Tree Level Order Traversal II Python Easy Tree
108 Convert Sorted Array to Binary Search Tree Python Easy Tree
110 Balanced Binary Tree Python Easy Tree
111 Minimum Depth of Binary Tree Python Easy
112 Path Sum Python Easy Tree
113 Path Sum II Python Medium Tree
114 Flatten Binary Tree to Linked List Python Medium Tree
116 Populating Next Right Pointers in Each Node Python Medium Tree
117 Populating Next Right Pointers in Each Node II Python Medium Tree
124 Binary Tree Maximum Path Sum Python Hard Tree
127 Word Ladder Python Medium BFS
129 Sum Root to Leaf Numbers Python Medium Tree
130 Surrounded Regions Python Medium Tree
133 Clone Graph Python Medium DFS
144 Binary Tree Postorder Traversal Python Medium Tree
145 Binary Tree Postorder Traversal Python Hard Tree
173 Binary Search Tree Iterator Python Medium Tree
199 Binary Tree Right Side View Python Medium Tree
200 Number of Islands Python Medium DFS
203 Remove Linked List Elements Python Medium Linkedlist
207 Course Schedule Python Medium Topological
210 Course Schedule II Python Medium Topological
222 Count Complete Tree Nodes Python Medium Tree
226 Invert Binary Tree Python Easy Tree
230 Kth Smallest Element in a BST Python Medium Tree
235 Lowest Common Ancestor of a Binary Search Tree Python Easy Tree
236 Lowest Common Ancestor of a Binary Tree Python Medium Tree
257 Binary Tree Paths Python Medium
292 Nim Game Python Easy Gaming
297 Serialize and Deserialize Binary Tree Python Hard Tree
301 Remove Invalid Parentheses Python Medium Array
304 Range Sum Query 2D - Immutable Python Hard DFS
310 Minimum Height Trees Python Medium Tree
326 Power of Three Python Easy Tree
332 Reconstruct Itinerary Python Medium DFS
337 House Robber III Python Medium DFS,Tree
394 Decode String Python Medium DFS,Stack
404 Sum of Left Leaves Python Easy Tree
417 Pacific Atlantic Water Flow Python Medium DFS
429 N-ary Tree Level Order Traversal Python Medium Tree
430 Flatten a Multilevel Doubly Linked List Python Medium DFS LinkedList
437 Path Sum III Python Easy Tree
449 Serialize and Deserialize BST Python Medium Tree
450 Delete Node in a BST Python Medium Tree
461 Hamming Distance Python Easy Array
472 Concatenated Words Python Hard DFS
473 Matchsticks to Square Python Medium DFS
478 Predict the Winner Python Medium DP
491 Increasing Subsequences Python Medium DFS
494 Target Sum Python Medium DFS,DP
501 Find Mode in Binary Search Tree Python Medium Tree
508 Most Frequent Subtree Sum Python Medium Tree
513 Find Bottom Left Tree Value Python Medium Tree
515 Find Largest Value in Each Tree Row Python Medium Tree
530 Minimum Absolute Difference in BST Python Easy Tree
538 Convert BST to Greater Tree Python Easy Tree
542 01 Matrix Python Medium BFS
543 Diameter of Binary Tree Python Easy Tree
547 Friend Circles Python Medium DFS
559 Maximum Depth of N-ary Tree Python Easy Tree
563 Binary Tree Tilt Python Easy Tree
572 Subtree of Another Tree Python Easy Tree
576 Out of Boundary Paths Python Medium DFS + DP
589 N-ary Tree Preorder Traversal Python Easy Tree
590 N-ary Tree Postorder Traversal Python Easy Tree
617 Merge Two Binary Trees Python Easy Tree
623 Add One Row to Tree Python Medium Tree
637 Average of Levels in Binary Tree Python Easy Tree
638 Shopping Offers Python Medium DFS+DP
652 Find Duplicate Subtrees Python Medium Tree
653 Two Sum IV - Input is a BST Python Medium Tree
654 Maximum Binary Tree Python Medium Tree
662 Maximum Width of Binary Tree Python Medium Tree
664 Strange Printer Python Hard DFS+DP
669 Trim a Binary Search Tree Python Easy Tree
671 Second Minimum Node In a Binary Tree Python Easy Tree
687 Longest Univalue Path Python Easy Tree
690 Employee Importance Python Easy BFS
695 Max Area of Island Python Medium DFS
698 Partition to K Equal Sum Subsets Python Medium dfs
701 Insert into a Binary Search Tree Python Medium Tree
721 Accounts Merge Python Medium DFS
733 Flood Fill Python Easy DFS
783 Minimum Distance Between BST Nodes Python Medium Tree
814 Binary Tree Pruning Python Medium Tree
863 All Nodes Distance K in Binary Tree Python Medium Tree
865 Smallest Subtree with all the Deepest Nodes Python Medium Tree
872 Leaf-Similar Trees Python Easy Tree
877 Stone Game Python Medium DP
889 Construct Binary Tree from Preorder and Postorder Traversal Python Medium Tree
894 All Possible Full Binary Trees Python Medium Tree
897 Increasing Order Search Tree Python Easy Tree
938 Range Sum of BST Python Easy Tree
951 Flip Equivalent Binary Trees Python Medium Tree
958 Check Completeness of a Binary Tree Python Medium Tree
965 Univalued Binary Tree Python Easy Tree
968 Binary Tree Cameras Python Hard Tree
979 Distribute Coins in Binary Tree Python Medium Tree
987 Vertical Order Traversal of a Binary Tree Python Medium Tree
988 Smallest String Starting From Leaf Python Medium Tree
993 Cousins in Binary Tree Python Easy Tree
998 Maximum Binary Tree II Python Medium Tree
1008 Construct Binary Search Tree from Preorder Traversal Python Medium Tree
1022 Sum of Root To Leaf Binary Numbers Python Easy Tree
1025 Divisor Game Python Easy Gaming
1026 Maximum Difference Between Node and Ancestor Python Medium Tree
1028 Recover a Tree From Preorder Traversal Python Hard Tree
1110 Delete Nodes And Return Forest Python Medium Tree
1123 Lowest Common Ancestor of Deepest Leaves Python Medium Tree
1140 Stone Game II Python Medium Gaming
1145 Binary Tree Coloring Game Python Medium Tree
1261 Find Elements in a Contaminated Binary Tree Python Medium Tree
1302 Deepest Leaves Sum Python Medium Tree
1305 All Elements in Two Binary Search Trees Python Medium Tree
1315 Sum of Nodes with Even-Valued Grandparent Python Medium Tree
1325 Delete Leaves With a Given Value Python Medium Tree
1337 The K Weakest Rows in a Matrix Python Easy Array
1339 Maximum Product of Splitted Binary Tree Python Medium Tree
1351 Count Negative Numbers in a Sorted Matrix Python Easy Array
1367 Linked List in Binary Tree Python Medium
1372 Longest ZigZag Path in a Binary Tree Python Medium Tree
1376 Time Needed to Inform All Employees Python Medium
1379 Find a Corresponding Node of a Binary Tree in a Clone of That Tree Python Medium
1391 Check if There is a Valid Path in a Grid Python Medium
1406 Stone Game III Python Hard
1408 String Matching in an Array Python Easy
1409 Queries on a Permutation With Key Python Medium
1410 HTML Entity Parser Python Medium
1411 Number of Ways to Paint N × 3 Grid Python Hard
1443 Minimum Time to Collect All Apples in a Tree Python Medium
1448 Count Good Nodes in Binary Tree Python Medium
1457 Pseudo-Palindromic Paths in a Binary Tree Python Medium
1466 Reorder Routes to Make All Paths Lead to the City Zero Python Medium
1475 Final Prices With a Special Discount in a Shop Python Easy
1480 Running Sum of 1d Array Python Easy
1481 Least Number of Unique Integers after K Removals Python Medium
1588 Sum of All Odd Length Subarrays Python Easy
1629 Slowest Key Python Easy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages