原创 Leetcode divide & conquer || Different Ways to Add Parentheses

241. Different Ways to Add Parentheses 題目描述 Given a string of numbers and operators, return all possible results f

原创 LeetCode Devide & Conquer Problem || Majority Element

題目描述 Given an array of size n, find the majority element. The majority element is the element that appears more th

原创 二進制中1的個數 | 劍指offer

題目描述 輸入一個整數,輸出該數二進制表示中1的個數。其中負數用補碼錶示。 思路分享 此題在熟練掌握計組課上的編碼基礎後很好解決,難度不大。 設輸入的十進制數爲n,二進制形式的1個數爲cnt。 正數實現 正數按照常見的10轉2

原创 LeetCode Devide & Conquer problem || Kth Largest Element in an Array

題目描述 Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted orde

原创 LeetCode Stack Problem || Next Greater Element

題目描述 Given a circular array (the next element of the last element is the first element of the array), print the Nex

原创 LeetCode Array Problem || Teemo Attacking

LeetCode Array Problem || Teemo Attacking 題目描述 In LLP world, there is a hero called Teemo and his attacking can mak

原创 LeetCode Sort Problem || Sort Colors

題目描述 Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adja

原创 二叉搜索樹的後序遍歷序列 | 劍指offer

題目描述 輸入一個整數數組,判斷該數組是不是某二叉搜索樹的後序遍歷的結果。如果是則輸出Yes,否則輸出No。假設輸入的數組的任意兩個數字都互不相同。 解題思路 回顧後序遍歷序列的特性:最後一個元素爲根,跟前面的序列可以分爲小於根的前半

原创 變態跳臺階 | 劍指offer

題目描述 一隻青蛙一次可以跳上1級臺階,也可以跳上2級……它也可以跳上n級。求該青蛙跳上一個n級的臺階總共有多少種跳法。 思路 爲了節省空間,本題嘗試使用非遞歸方法解決。開闢一個數組series[number+1]存儲各階跳法。 階

原创 54. Spiral Matrix Solution | Leetcode Array

Leetcode 54. Spiral MatrixDescriptionSolution Description Given a matrix of m x n elements (m rows, n columns), retur

原创 377. Combination Sum IV | Leetcode Dynamic Programming

Description Given an integer array with all positive numbers and no duplicates, find the number of possible combination

原创 Sicily 會議安排 | 算法期末機考模擬題

Description N個會議要同時舉行,參會人數分別爲A[0], A[1], …, A[N-1]. 現有M個會議室,會議室可容納人數分別爲B[0], B[1], …, B[M-1]. 當A[i]<=B[j]時,可以把會議i安排在會議室

原创 中山大學計算機組成原理多週期CPU實驗

中山大學2016計算機組成原理多週期CPU實驗 實驗老師給我們羅列了很細緻的控制線路圖~然而一些細節部分,博主並沒有完全按照老師給出的圖做,也許也會有些bug,歡迎大家指出,多多交流~ 實驗要求 基本上來說與單週期CPU設計實驗基本相同

原创 406. Queue Reconstruction by Height | Leecode Greedy

Description Suppose you have a random list of people standing in a queue. Each person is described by a pair of integer

原创 452. Minimum Number of Arrows to Burst Balloons| Leetcode Greedy

Description There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input