随笔分类 - 算法分析与设计
算法分析与设计作业 - LeetCode
摘要:375. Guess Number Higher or Lower II We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which numbe
阅读全文
摘要:Week13 376. Wiggle Subsequence A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate betw
阅读全文
摘要:Week 12 673.Number of Longest Increasing Subsequence Given an unsorted array of integers, find the number of longest increasing subsequence. Example 1
阅读全文
摘要:Week 11 343.Integer Break Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those intege
阅读全文
摘要:474. Ones and Zeroes In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue. For now, su
阅读全文
摘要:638.Shopping Offers Medium In LeetCode Store, there are some kinds of items to sell. Each item has a price. However, there are some special offers, an
阅读全文
摘要:338.Counting Bits Medium Given a non negative integer number num . For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their b
阅读全文
摘要:714. Best Time to Buy and Sell Stock with Transaction Fee Medium Your are given an array of integers , for which the th element is the price of a give
阅读全文
摘要:Week6 676.Implement Magic Dictionary Implement a magic directory with buildDict, and search methods. For the method buildDict, you'll be given a list
阅读全文
摘要:529.Minesweeper Let's play the minesweeper game (Wikipedia, online game)! You are given a 2D char matrix representing the game board. 'M' represents a
阅读全文
摘要:500.Keyboard Row & 557.Reverse Words in a String III 500.Keyboard Row Given a List of words, return the words that can be typed using letters of alpha
阅读全文
摘要:Week3 397. Integer Replacement 397.Integer Replacement Medium Given a positive integer n and you can do operations as follow: 1.If n is even, replace
阅读全文
摘要:Week2 669. Trim a Binary Search Tree & 617. Merge Two Binary Trees 669.Trim a Binary Search Tree Given a binary search tree and the lowest and highest
阅读全文
摘要:这周刚开始讲了一点Divide and Conquer的算法,于是这周的作业就选择在LeetCode上找分治法相关的题目来做。 169.Majority Element Given an array of size n, find the majority element. The majority
阅读全文