Skip to content

LeetCode-LintCode-Solutions/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Success is like pregnancy, Everybody congratulates you but nobody knows how many times you were screwed to achieve it.

Algorithms

Linked List

Overview

Linked List Basic

# Title Solution Time Space Difficulty Tag Note
21 Merge Two Sorted Lists Python O(n) O(n) Easy Iteratively
89 Partition List Python O(n) O(n) Easy CC189
141 Linked List Cycle Python O(n) O(1) Easy CC189 Two Pointers
160 Intersection of Two Linked Lists Python O(n) O(1) Easy
203 Remove Linked List Elements Python O(n) O(1) Easy
206 Reverse Linked List Python O(n) O(1) Easy CC189 Video Tutorial
234 Palindrome Linked List Python O(n) O(1) Easy CC189 Two Pointers
2 Add Two Numbers Python O(n) O(n) Medium CC189
445 Add Two Numbers II Python O(n) O(n) Medium CC189 Stack

4/14 Tasks (LinkedList Medium)

# Title Solution Time Space Difficulty Tag Note
142 Linked List Cycle II Python O(n) O(1) Medium CC189 Video
328 Odd Even Linked List Python O(n) O(1) Medium
143 Reorder List Python O(n) O(1) Medium
24 Swap Nodes in Pairs Python O(n) O(1) Medium Note

4/15 Tasks (LinkedList Medium)

# Title Solution Time Space Difficulty Tag Note
83 Remove Duplicates from Sorted List Python O(n) O(1) Easy
148 Sort List Python O(nlogn) O(1) Medium
61 Rotate List Python O(n) O(1) Medium
19 Remove Nth Node From End of List Python O(n) O(1) Medium

4/16 Tasks (LinkedList Medium)

# Title Solution Time Space Difficulty Tag Note
138 Copy List with Random Pointer Python O(n) O(n) Medium

4/17 Tasks (Stacks and Queues: CtCi Chapter 3)

# Title Solution Time Space Difficulty Tag Note

4/18 Tasks (Stacks Easy)

# Title Solution Time Space Difficulty Tag Note
155 Min Stack Python O(1) O(n) Easy
225 Implement Stack using Queues Python push/pop: O(1) top:O(n) O(n) Easy
20 Valid Parentheses Python O(n) O(n) Easy
346 Moving Average from Data Stream Python O(1) O(n) Easy

4/22 Tasks (Tree Easy)

# Title Solution Time Space Difficulty Tag Note
110 Balanced Binary Tree Python [Yu] O(N) O(h) Easy
112 Path Sum Python [Yu] O(N) O(h) Easy 中文讲解

Tree Easy

# Title Solution Time Space Difficulty Tag Note
100 Same Tree Python [Yu] O(N) O(1) Easy
101 Symmetric Tree Python [Yu] O(N) O(1) Easy 公瑾讲解
104 Maximum Depth of Binary Tree Python O(N) O(1) Easy
108 Convert Sorted Array to Binary Search Tree Python [Yu] O(N) O(N) Easy 公瑾讲解
111 Minimum Depth of Binary Tree Python [Yu] O(N) O(1) Easy
235 Lowest Common Ancestor of a Binary Search Tree Python O(N) O(1) Easy
226 Invert Binary Tree Python [Yu] O(N) O(1) Easy 公瑾讲解
543 Diameter of Binary Tree Python [Yu] O(N) O(h) Easy 公瑾讲解
501 Find Mode in Binary Search Tree Python [Yu] O(N) O(N) Easy 公瑾讲解
257 Binary Tree Paths Python [Yu] O(N) O(N) Easy 公瑾讲解
572 Subtree of Another Tree Python [Yu] O(S*T) O(1) Easy 公瑾讲解
437 Path Sum III Python [Yu] O(N^2) O(1) Easy
404 Sum of Left Leaves Python [Yu] O(N) O(1) Easy 公瑾讲解
270 Closest Binary Search Tree Value Python [Yu] O(N) O(1) Easy 公瑾讲解
563 Binary Tree Tilt Python [Yu] O(N) O(1) Easy 公瑾讲解

Tree Medium

# Title Solution Time Space Difficulty Tag Note
102 Binary Tree Level Order Traversal Python [Yu] O(N) O(N) Medium 公瑾讲解
107 Binary Tree Level Order Traversal II Python [Yu] O(N) O(N) Medium
515 Find Largest Value in Each Tree Row Python [Yu] O(N) O(1) Medium

About

👏🏻 leetcode solutions for Humans™

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%