
作业
文章平均质量分 65
SYSU_LiuBY
这个作者很懒,什么都没留下…
展开
-
排队算法优化
排队算法优化一、起因 按照订单简单的FIFO排队,做完一桌菜再做下一桌菜,这样会导致大量的等待时间,可会体验会不太好,因此提出以下算法模型。二、若干模型以及算法细节假定我们已经清楚各个菜品制作所需要的时间;考虑A、B两桌订单时间存在重叠,B桌的菜品必须等待前一桌A桌的菜品全上完全了再开始做。考虑A桌订单提交时间为Ta0,所需时间为ta,B桌订单提交时间为Tb0,所需时间为tb,则这样决策B所需等待...原创 2018-07-03 21:47:41 · 6397 阅读 · 0 评论 -
2017-09-11 LeetCode_024 Swap Nodes in Pairs
24. Swap Nodes in PairsGiven a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should原创 2017-09-11 11:32:54 · 155 阅读 · 0 评论 -
2017-09-11 LeetCode_023 Merge k Sorted Lists
23. Merge k Sorted ListsMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.solution:class Solution {2原创 2017-09-11 11:20:16 · 155 阅读 · 0 评论 -
2017-09-11 LeetCode_022 Generate Parentheses
22. Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", "原创 2017-09-11 10:58:50 · 151 阅读 · 0 评论 -
2017-09-11 LeetCode_021 Merge Two Sorted Lists
21. Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.solution:原创 2017-09-11 10:37:33 · 193 阅读 · 0 评论 -
2017-09-10 LeetCode_020 Valid Parentheses
20. Valid ParenthesesGiven a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()原创 2017-09-10 17:42:16 · 136 阅读 · 0 评论 -
2017-09-10 LeetCode_019 Remove Nth Node From End of List
19. Remove Nth Node From End of ListGiven a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After原创 2017-09-10 17:22:24 · 129 阅读 · 0 评论 -
2017-09-10 LeetCode_018 4Sum
18. 4SumGiven an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note原创 2017-09-10 17:00:14 · 161 阅读 · 0 评论 -
2017-09-10 LeetCode_017 Letter Combinations of a Phone Number
17. Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telepho原创 2017-09-10 16:22:07 · 232 阅读 · 0 评论 -
2017-09-09 LeetCode_016 3Sum Closest
16. 3Sum ClosestGiven an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that eac原创 2017-09-09 17:32:55 · 196 阅读 · 0 评论 -
2017-09-09 LeetCode_015 3Sum
15. 3SumGiven an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set mu原创 2017-09-09 17:16:13 · 228 阅读 · 0 评论 -
2017-09-11 LeetCode_025 Reverse Nodes in k-Group
25. Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to the length o原创 2017-09-11 13:17:53 · 202 阅读 · 0 评论 -
2017-09-19 LeetCode_030 Substring with Concatenation of All Words
30. Substring with Concatenation of All WordsYou are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a原创 2017-09-19 15:14:35 · 318 阅读 · 0 评论 -
系统分析与应用_EX02
系统分析与应用(二)学号:15331211姓名:刘秉运 一、简答题1. 简述瀑布模型、增量模型、螺旋模型(含原型方法)的优缺点。瀑布模型的优点:² a) 降低软件开发的复杂程度,提高软件开发过程的透明性,提高软件开发过程 的可管理性² b) 推迟软件实现,强调在软件实现前必须进行分析和设计工作² c) 以项目的阶段评审和文档控制为手段有效地对整个开发过程进行指导,保证 了阶段之间的正确衔接,...原创 2018-03-22 23:16:06 · 277 阅读 · 0 评论 -
系统分析与应用_EX01
系统分析与应用(一) 学号:15331211姓名:刘秉运一、简答题1. 软件工程的定义:a)将系统化、规范化、可度量的方法应用与软件的开发、运行和维护的过程,即将工程化应用于软件中。b)对a)中所述方法的研究。c)软件工程是指导计算机软件开发和维护的工程学科。采用工程的概念、原理、技术和方法来开发与维护软件,把经过实践考验而证明正确的管理技术和当前能够得到的最好的技术方法结合起来。2. 阅读经...原创 2018-03-15 02:22:14 · 461 阅读 · 0 评论 -
2017-09-21 LeetCode_033 Search in Rotated Sorted Array
33. Search in Rotated Sorted ArraySuppose 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 g原创 2017-09-21 22:23:08 · 208 阅读 · 0 评论 -
2017-09-21 LeetCode_032 Longest Valid Parentheses
.32. Longest Valid ParenthesesGiven a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid原创 2017-09-21 22:04:28 · 345 阅读 · 0 评论 -
2017-09-21 LeetCode_031 Next Permutation
31. Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange原创 2017-09-21 21:27:09 · 193 阅读 · 0 评论 -
2017-09-12 LeetCode_218 The Skyline Problem
218. The Skyline ProblemA city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you aregiven the locations and原创 2017-09-13 02:29:58 · 251 阅读 · 0 评论 -
2017-09-12 LeetCode_215 Kth Largest Element in an Array
215. Kth Largest Element in an ArrayFind the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,原创 2017-09-12 14:04:00 · 157 阅读 · 0 评论 -
2017-09-12 LeetCode_169 Majority Element
169. Majority ElementGiven an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empt原创 2017-09-12 11:38:58 · 158 阅读 · 0 评论 -
2017-09-12 LeetCode_053 Maximum Subarray
53. Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contigu原创 2017-09-12 11:22:23 · 160 阅读 · 0 评论 -
2017-09-12 LeetCode_026 Remove Duplicates from Sorted Array
26. Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space fo原创 2017-09-12 11:05:30 · 183 阅读 · 0 评论 -
2017-09-17 LeetCode_029 Divide Two Integers
29. Divide Two IntegersDivide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.solution:class Solution {原创 2017-09-18 01:10:31 · 358 阅读 · 0 评论 -
2017-09-17 LeetCode_028 Implement strStr()
28. Implement strStr()Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.solution:class原创 2017-09-18 00:48:25 · 386 阅读 · 0 评论 -
2017-09-17 LeetCode_027 Remove Element
27. Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place w原创 2017-09-18 00:35:08 · 394 阅读 · 0 评论 -
2017-09-14 LeetCode_315 Count of Smaller Numbers After Self
315. Count of Smaller Numbers After SelfYou are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smal原创 2017-09-14 03:00:48 · 215 阅读 · 0 评论 -
2017-09-14 LeetCode_327 Count of Range Sum
327. Count of Range SumGiven an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Range sum S(i, j) is defined as the sum of the elements in nums bet原创 2017-09-14 21:07:12 · 185 阅读 · 0 评论 -
2017-09-07 LeetCode_003 Longest Substring Without Repeating Characters
3. Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", w原创 2017-09-07 16:48:38 · 177 阅读 · 0 评论 -
2017-09-07 LeetCode_004 Median of Two Sorted Arrays
4. Median of Two Sorted ArraysThere are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should原创 2017-09-07 16:44:15 · 144 阅读 · 0 评论 -
2017-09-07 LeetCode_002 Add Two Numbers
2. Add Two NumbersYou 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. Add th原创 2017-09-07 15:38:27 · 208 阅读 · 0 评论 -
2017-09-07 LeetCode_001 Two Sum
1. Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may原创 2017-09-07 14:57:09 · 182 阅读 · 0 评论 -
2017-09-13 LeetCode_312 Burst Balloons
312. Burst BalloonsGiven 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原创 2017-09-14 01:52:30 · 225 阅读 · 0 评论 -
2017-09-13 LeetCode_282 Expression Add Operators
282. Expression Add OperatorsGiven a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the digits so原创 2017-09-14 01:08:45 · 149 阅读 · 0 评论 -
2017-09-13 LeetCode_241 Different Ways to Add Parentheses
282. Expression Add OperatorsGiven a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the digits so原创 2017-09-14 01:06:47 · 162 阅读 · 0 评论 -
2017-09-13 LeetCode_241 Different Ways to Add Parentheses
241. Different Ways to Add ParenthesesGiven a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The va原创 2017-09-13 14:29:17 · 206 阅读 · 0 评论 -
2017-09-15 LeetCode_493 Reverse Pairs
493. Reverse PairsGiven an array nums, we call (i, j) an important reverse pair if i and nums[i] > 2*nums[j].You need to return the number of important reverse pairs in the given array.原创 2017-09-15 18:48:43 · 314 阅读 · 0 评论 -
2017-09-07 LeetCode_005 Longest Palindromic Substring
5. Longest Palindromic SubstringGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "bab"原创 2017-09-07 17:10:44 · 163 阅读 · 0 评论 -
2017-09-09 LeetCode_014 Longest Common Prefix
14. Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.solution:class Solution {2public:原创 2017-09-09 15:34:26 · 167 阅读 · 0 评论 -
2017-09-09 LeetCode_013 Roman to Integer
13. Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.solution:class Solution {原创 2017-09-09 15:24:23 · 203 阅读 · 0 评论