原创 遞歸(2)

題目: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the

原创 Maximum Subarray

Problem: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. Fo

原创 Palindrome Number

題目: Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Subscribe t

原创 分治算法的運用

題目: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, no

原创 A*算法的簡單運用

1、 Problem DescriptionThis is a problem that is prominently featured in the lm Die Hard With a Vengeance. You have a3-g

原创 Best Time to Buy and Sell Stock with Cooldown

題目: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to f

原创 Climbing Stairs

題目: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps

原创 python六大標準數據類型的介紹

python是一門熱門的編程語言,也是一門熱門的腳本語言,python中的六大標準類型分別爲:數字、字符串、列表、元組、集合、字典。接下來我爲大家介紹一下這六大類型: 1、數字 (1)數字的類型:整型(int)、浮點型(float)、複數

原创 遍歷二叉樹

題目: Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree [1,null,2,

原创 遞歸

題目: Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations i

原创 Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only m

原创 Combinations

題目: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If n = 4 a

原创 遞歸的運用

題目: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following

原创 Unique Paths II

題目: Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would

原创 算法概論課後習題8.8

設3SAT的實例I=(a1V a2V a3)(a4 V a5 V a6)...(.anV an+1V an+2) 根據4SAT問題的條件,每個變量最多在每個子句中出現一次。如果某個變量在子句中出現多次,則縮減爲1次。 如果某個子句中