算法
算法解析
Vilinzz
这个作者很懒,什么都没留下…
-
原创 算法设计与分析(十一)--动态规划
1. Unique Binary Search Trees 2. Unique Binary Search Trees II Unique Binary Search Trees 题目 Given n, how many structurally unique BST’s (binary search trees) that store values 1 … n? 分析 这题是典型的卡特兰数的例...2018-11-16 19:22:14110
0
-
原创 Unique Paths II(动态规划)
Unique Paths II 题目 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 move either down or right at any point in time. The robot is tryi...2018-11-04 14:28:08113
0
-
原创 Longest Valid Parentheses(动态规划)
Longest Valid Parentheses 题目 Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring. Example 1: Input: “(()” Output: 2 Expl...2018-11-04 13:33:37290
0
-
原创 算法设计与分析(九)--动态规划
Burst Balloons 题目 Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i yo...2018-10-30 22:14:5385
0
-
原创 算法设计与分析--动态规划(八)
Longest Increasing Path in a Matrix 题目 Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or down. You may...2018-10-27 11:37:18117
0
-
原创 算法设计与分析(七)
贪心算法 题目 这次我们选择两题贪心算法作为练习,这两道题目是有关系的,一个是比较基础的贪心,另一个是难一点的贪心。 Jump Game Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array re...2018-10-18 23:46:5156
0
-
原创 LeetCode--Keys and Rooms
Keys and Rooms 题目 There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, …, N-1, and each room may have some keys to access the next room. Formally, each room i has a ...2018-10-14 22:20:2670
0
-
原创 算法设计与分析(六
Merge k Sorted Lists 题目 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1-&gt2018-10-11 19:30:1158
0
-
原创 算法设计与分析(五)
Is Graph Bipartite? 1. 题目 Given an undirected graph, return true if and only if it is bipartite. Recall that a graph is bipartite if we can split it’s set of nodes into two independent subsets A and B...2018-10-04 10:04:3184
0
-
原创 算法设计与分析第四周练习(图论)
Network Delay Time 1. 题目 There are N network nodes, labelled 1 to N. Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v is the target node, and ...2018-09-28 13:54:57123
0