![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法分析与设计
N1klausss
大学软件狗一枚
展开
-
二叉树的合并与逆转
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.原创 2017-09-10 13:58:55 · 689 阅读 · 0 评论 -
Counting Bits
问题描述 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 binary representation and return them as an array. Example: For n原创 2018-01-09 23:37:49 · 172 阅读 · 0 评论 -
House Robber
问题描述You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent ho原创 2018-01-09 22:56:22 · 145 阅读 · 0 评论 -
Word Break
问题描述 Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words. You ma原创 2018-01-09 22:45:59 · 158 阅读 · 0 评论 -
Unique Binary Search Trees
问题描述 Given n, how many structurally unique BST’s (binary search trees) that store values 1…n? For example, Given n = 3, there are a total of 5 unique BST’s. 1 3 3 2 1原创 2018-01-09 21:38:38 · 158 阅读 · 0 评论 -
Search in Rotated Sorted Array
问题描述 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target value to search.原创 2018-01-09 21:20:08 · 153 阅读 · 0 评论 -
Merge Intervals
问题描述 Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18].分析先使用sort函数对vector里的区间按照头从小到大排序,然后在判断其尾部大原创 2018-01-09 20:55:29 · 153 阅读 · 0 评论 -
Search for a Range
问题描述 Given an array of integers sorted in ascending order, find the starting and >ending position of a given target value. Your algorithm’s runtime complexity must be in the order of O(log n).原创 2018-01-09 20:13:53 · 138 阅读 · 0 评论 -
Longest Substring Without Repeating Characters
问题描述 Given a string, find the length of the longest substring without repeating characters. Examples: Given “abcabcbb”, the answer is “abc”, which the length is 3. Given “bbbbb”, the ans原创 2018-01-09 20:06:24 · 150 阅读 · 0 评论 -
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 move either down or right at any point in time. The robot is trying to re原创 2018-01-13 23:40:12 · 145 阅读 · 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 represents your maximum jump length at that position. D原创 2018-01-13 23:25:45 · 141 阅读 · 0 评论 -
Reverse string
问题描述 Write a function that takes a string as input and returns the string reversed.原创 2017-12-05 17:00:09 · 205 阅读 · 0 评论 -
Add two numbers
问题描述 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit.原创 2017-10-10 23:46:47 · 225 阅读 · 0 评论 -
Remove Duplicates from Sorted Array
问题描述 Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.原创 2017-10-18 10:17:16 · 143 阅读 · 0 评论 -
平衡二叉树的判断
Given a binary tree, determine if it is height-balanced.原创 2017-09-19 15:31:25 · 330 阅读 · 0 评论 -
系统分析与设计HW4
1.用例建模a.阅读 Asg_RH 文档,绘制用例图。按 Task1 要求,请使用工具 UMLet,截图格式务必是 png 并控制尺寸b.选择你熟悉的定旅馆在线服务系统(或移动 APP),如绘制用例图。并满足以下要求:对比 Asg_RH 用例图,请用色彩标注出创新用例或子用例 尽可能识别外部系统,并用色彩标注新的外部系统和服务 例如去哪网: c.对比两个时...原创 2018-04-22 23:22:08 · 216 阅读 · 0 评论