iT邦幫忙

algorithm相關文章
共有 358 則文章
LeetCode Top 100 Liked 系列 第 45 篇

技術 [Day 45] Reverse Nodes in k-Group (Hard)

25. Reverse Nodes in k-Group Solution 1: Iterative class Solution: def rever...

LeetCode Top 100 Liked 系列 第 44 篇

技術 [Day 44] Lowest Common Ancestor of a Binary Tree (Medium)

236. Lowest Common Ancestor of a Binary Tree Solution 1: DFS class Solution:...

LeetCode Top 100 Liked 系列 第 43 篇

技術 [Day 43] Sort List (Medium)

148. Sort List Solution 1: Merge Sort # Definition for singly-linked list. # cla...

LeetCode Top 100 Liked 系列 第 42 篇

技術 [Day 42] Unique Binary Search Trees (Medium)

96. Unique Binary Search Trees Solution 1: DP class Solution: def numTrees(s...

LeetCode Top 100 Liked 系列 第 41 篇

技術 [Day 41] Next Permutation (Medium)

31. Next Permutation Solution 1: Two Pointer class Solution: ""&qu...

LeetCode Top 100 Liked 系列 第 40 篇

技術 [Day 40] Subsets (Medium)

78. Subsets Solution 1: Bitwise class Solution(object): def subsets(self, nu...

LeetCode Top 100 Liked 系列 第 39 篇

技術 [Day 39] Number of Islands (Medium)

200. Number of Islands Solution 1: DFS + Bitmap class Solution: def numIslan...

LeetCode Top 100 Liked 系列 第 38 篇

技術 [Day 38] Minimum Window Substring (Hard)

76. Minimum Window Substring Solution 1: Slide Window + Hash from collections im...

LeetCode Top 100 Liked 系列 第 37 篇

技術 [Day 37] Jump Game (Medium)

55. Jump Game Solution 1: DP (Tail -> Head) class Solution: def canJump(s...

LeetCode Top 100 Liked 系列 第 36 篇

技術 [Day 36] Intersection of Two Linked Lists (Easy)

160. Intersection of Two Linked Lists Solution 1: Brute-Force class Solution:...

技術 Day 32 你看我 CS - Counting Sort

Counting Sort 是以數字為基礎的排序演算法,其需要定義最大範圍值,作為排序用,整體算法較簡單且速度較快,缺點就是排序元素需要確定在最大範圍值內且需要...

LeetCode Top 100 Liked 系列 第 34 篇

技術 [Day 34] Find the Duplicate Number (Medium)

287. Find the Duplicate Number Solution 1: Brute-Force (TLE) class Solution:...

LeetCode Top 100 Liked 系列 第 33 篇

技術 [Day 33] Longest Valid Parentheses (Hard)

32. Longest Valid Parentheses Solution 1: Stack class Solution: def longestV...

LeetCode Top 100 Liked 系列 第 32 篇

技術 [Day 32] Coin Change (Medium)

322. Coin Change Solution 1: DP (Amount outer loop) class Solution: def coin...

LeetCode Top 100 Liked 系列 第 31 篇

技術 [Day 31] Letter Combinations of a Phone Number (Medium)

17. Letter Combinations of a Phone Number Solution 1: Recursive + DFS class Solu...

鐵人賽 自我挑戰組 DAY 30
LeetCode Top 100 Liked 系列 第 30 篇

技術 [Day 30] Merge k Sorted Lists (Hard)

23. Merge k Sorted Lists Question You are given an array of k linked-lists lists...

鐵人賽 自我挑戰組 DAY 29
LeetCode Top 100 Liked 系列 第 29 篇

技術 [Day 29] Roman to Integer (Easy)

13. Roman to Integer Question Roman numerals are represented by seven different...

技術 Day 31 41分推 - Dynamic Programming

解決一個問題時,若此問題可以分解成多個重複性的子問題,且這些子問題的解答可以構成最終該問題的解答,則我們可以用 Dynamic Programming 的技巧,...

技術 Day 30 太無情了 - Dijkstra's Algorithm

此演算法是由一位叫 Edsger Dijkstra 的荷蘭工程師所發明,他在電腦科學領域貢獻了許多奠定目前網際網路、電腦科學與數位服務等等的基礎。 在學習 D...

鐵人賽 Software Development DAY 30

技術 Day 29 走囉~高歌離席~ - Graph Traversal

當要取得、更新、檢查 Graph 裡所有的節點時就會需要用到 Traversal 方法,常見的使用場景為點對點的網際網路、網站爬蟲、導航、迷宮問題或遊戲類的 A...

鐵人賽 Software Development DAY 29

技術 Day 28 又肉又痛 - Graph

簡言之, Graph 就是很多個節點與節點之間的連線所組成的,前幾天提到的 Three 也算是 Graph 的一種 , Graph 主要有以下幾點特色: Gr...

鐵人賽 自我挑戰組 DAY 28
LeetCode Top 100 Liked 系列 第 28 篇

技術 [Day 28] Combination Sum (Medium)

39. Combination Sum Question Given an array of distinct integers candidates and...

鐵人賽 自我挑戰組 DAY 27
LeetCode Top 100 Liked 系列 第 27 篇

技術 [Day 27] Largest Rectangle in Histogram (Hard)

84. Largest Rectangle in Histogram Question Given an array of integers heights r...

鐵人賽 Software Development DAY 28

技術 Day 27 迷因新寵兒 - Hash Table

From Medium Hash Table 是用來儲存鍵值對的資料 (key-value pairs)。 而 Hash Table 在找特定資料與新增刪除...

鐵人賽 Software Development DAY 27

技術 Day 26 展現解題 GAP - Heap Sort

Heap Sort 使用 Binary Heap 處理資料排序,也可視為 Selection Sort 的改良版。 兩者一樣都是將資料分成兩區,一區為排序好的,...

鐵人賽 自我挑戰組 DAY 26
LeetCode Top 100 Liked 系列 第 26 篇

技術 [Day 26] Symmetric Tree (Easy)

101. Symmetric Tree Question Given the root of a binary tree, check whether it i...

鐵人賽 自我挑戰組 DAY 25
LeetCode Top 100 Liked 系列 第 25 篇

技術 [Day 25] Permutations (Medium)

46. Permutations Question Given an array nums of distinct integers, return all t...

鐵人賽 自我挑戰組 DAY 24
LeetCode Top 100 Liked 系列 第 24 篇

技術 [Day 24] Search in Rotated Sorted Array (Medium)

33. Search in Rotated Sorted Array Question There is an integer array nums sorte...

鐵人賽 自我挑戰組 DAY 23
LeetCode Top 100 Liked 系列 第 23 篇

技術 [Day 23] Remove Nth Node From End of List (Medium)

19. Remove Nth Node From End of List Question Given the head of a linked list, r...

鐵人賽 Software Development DAY 24

技術 Day 23 極速解題 - Tree Sort

Tree Sort 簡而言之就是使用 Tree 結構來排序資料,建議先看資料結構篇章中的 Binary Search Tree 和 Tree Traversal...