目標:這題主要目的在於幫助讀者熟悉具備不確定條件的DP題目。 原題: Question: You are a professional robber plann...
目標:這題主要目的同樣是協助讀者熟悉陣列操作。 原題: Question: Given an array, rotate the array to the ri...
目標:這題主要目的在於再進一步引導讀者去思考如何做出一個適合dp的鏈結關係。 原題: Question: Given n, how many structura...
目標:這題主要目的在於讓讀者繼續熟悉一些陣列的常用操作及方法。 原題: Question: Given an array nums, write a funct...
目標:這題主要目的在於延伸前面解過的題目,再進行一點變化,同樣屬於DP的範疇。 原題: Question: A robot is located at the...
目標:這題主要目的在於進一步討論摩爾投票算法的延伸。 原題: Question: Given an integer array of size n, find...
目標:這題主要目的在於介紹一個特別的演算法,它叫做Boyer–Moore majority vote algorithm(摩爾投票算法)。同時,接下來也會多介紹...
目標:這題主要目的在於進一步講解需要二維陣列輔助解的DP問題。 原題: Question: A robot is located at the top-left...
目標:這題主要目的在於了解平衡樹的觀念,並幫助讀者學習如何考慮一棵樹在高度平衡時的操作所需的時間複雜度。 原題: Question: Given a binar...
目標:這題主要目的在於讓讀者更清楚樹的深度(depth)的觀念。 原題: Question: Given a binary tree, find its min...
目標:這題主要目的在於進階探索Tree較複雜的問題。 原題: Question: Given a non-empty binary tree, find the...
目標:這題主要目的在於介紹二元樹的中序走訪,同時用stack結構來講解迭代解的思路。 原題: Question: Given a binary tree, re...
目標:這題主要目的在於介紹二元樹中最常見實用的類別:二元搜尋樹(Binary Search Tree) 原題: Question: Given a binary...
目標:這題主要目的在於透過題目來介紹前面提過的Bitwise Operation的應用。 原題: Question: Given a non-empty arr...
目標:選取這題主要目的在於了解二元樹基本的延伸以外,也介紹了另一個常用的資料結構:Queue,用以處理迭代解(Iterative solution)的方法。 原...
目標:這題主要目的在於介紹常見的資料結構:樹(Tree) 原題: Question: Given two binary trees, write a funct...
目標:這題主要目的在於理解常見的資料結構:堆疊(Stack),同時也會處理常見的Linked List。 原題: Question: Reverse a lin...
目標:這篇的目標是介紹Gray Code以及二進位的位元運算部分。 原題: Question: The gray code is a binary numera...
目標:選這題的目標旨在說明更為典型的動態規劃算法。 原題: Question: You are climbing a staircase. It takes n...
目標:這題的目標在於講述簡單的字串操作方式,以及簡單的二進位的表示法。 原題: Question: Given two binary strings, retu...
目標:這題主要目的在於學習一個常見的演算法:動態規劃(Dynamic Programming)。 原題: Question: Given an integer...
目標:這題主要目的在於了解如何處理以排序陣列的快速方法:二元搜尋法。 原題: Question: Given a sorted array and a targ...
目標:這題主要目的在於闡明In-place algorithm的含義,以及使用In-place的條件下會受到的限制。 原題: Question: Given a...
目標:這題主要目的在於引導讀者了解Linked List的資料結構以及基本操作。 原題: Question: Merge two sorted linked l...
目標:這題主要目的在於練習Two Pointer類型的問題應用。 原題: Question: Given an array nums of n integers...
目標:這題主要目的在於練習常見的字串比對處理。 原題: Question: Write a function to find the longest commo...
前言 希望透過這系列文章,可以讓自己的演算法、資料結構的基礎知識可以更扎實,也希望這系列文章可以幫助到JavaScript工程師,讓自己寫的程式效率能更好。在...
目標:這題主要目的在於練習HashMap/Dictionary的應用。 原題: Question: Given an array of integers, re...
寫在前面 容許筆者自我工商一下,如果喜歡這一系列的文章,我也有陸續寫新的文章,放在我的Medium中,有興趣的歡迎光臨XD~ 其目錄項次會放在第一篇(在Medi...
這篇文章主要敘述我用基因遺傳演算法解旅行推銷員問題,用的語言是Python。這邊會一步一步帶過程式碼,之後也會上傳到Github。演算法參考:https://t...