算法设计与分析(十三)

Count of Range Sum 题目 Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive. Range sum S(i, j) is defined...

2018-11-27 21:45:08

阅读数:25

评论数:0

算法设计与分析(十二)--动态规划

Target Sum 题目 You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you sh...

2018-11-25 00:16:28

阅读数:8

评论数:0

算法设计与分析(十一)--动态规划

1. Unique Binary Search Trees 2. Unique Binary Search Trees II Unique Binary Search Trees 题目 Given n, how many structurally unique BST’s (binary sear...

2018-11-16 19:22:14

阅读数:33

评论数:0

算法设计与分析--动态规划(十)

Scramble String 题目 Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one p...

2018-11-08 13:24:14

阅读数:24

评论数: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 bu...

2018-10-30 22:14:53

阅读数:14

评论数: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 t...

2018-10-27 11:37:18

阅读数:14

评论数:0

算法设计与分析(七)

贪心算法 题目 这次我们选择两题贪心算法作为练习,这两道题目是有关系的,一个是比较基础的贪心,另一个是难一点的贪心。 Jump Game Given an array of non-negative integers, you are initially positioned at the fir...

2018-10-18 23:46:51

阅读数:14

评论数: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-&a...

2018-10-11 19:30:11

阅读数:20

评论数: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’...

2018-10-04 10:04:31

阅读数:16

评论数: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), whe...

2018-09-28 13:54:57

阅读数:16

评论数:0

算法分析与设计第三周练习(图论)

目录 Evaluate Division Reconstruct Itinerary 总结 Evaluate Division 1. 题目 Equations are given in the format A / B = k, where A and B are variables ...

2018-09-21 23:07:40

阅读数:12

评论数:0

算法设计与分析第二周练习

目录 Course Schedule(拓扑) Kth Largest Element in an Array(分治算法) Kth Largest Element in an Array 题目 Find the kth largest element in an unsorted arra...

2018-09-14 18:50:27

阅读数:18

评论数:0

算法设计与分析第一周练习

题目 Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two e...

2018-09-07 00:01:37

阅读数:21

评论数:0

算法设计与分析(十四)

Maximum Product Subarray 题目 Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the ...

2018-12-09 14:30:55

阅读数:7

评论数:0

Edit Distance(动态规划)

Edit Distance 题目 Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 ...

2018-11-04 15:15:43

阅读数:33

评论数:1

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 do...

2018-11-04 14:28:08

阅读数:35

评论数:0

Longest Valid Parentheses(动态规划)

Longest Valid Parentheses 题目 Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parenthese...

2018-11-04 13:33:37

阅读数:25

评论数: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...

2018-10-14 22:20:26

阅读数:13

评论数:0

3Sum

3Sum 1.题目 Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array whic...

2018-09-24 23:49:16

阅读数:16

评论数:0

LeetCode--Longest Common Prefix

Longest Common Prefix 题目 Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, retu...

2018-09-24 21:08:58

阅读数:15

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭