摘要: 出处: https://www.cnblogs.com/shindo/p/5579191.html 平时阅读一些远吗分析类文章或是设计应用架构时没少与UML类图打交道。实际上,UML类图中最常用到的元素五分钟就能掌握,下面赶紧来一起认识一下它吧: 一、类的属性的表示方式 在UML类图中,类使用包含类 阅读全文
posted @ 2018-04-20 07:17 davidnyc 阅读(335) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/description/Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?For example,Given sorted array nums = [1... 阅读全文
posted @ 2018-04-16 23:52 davidnyc 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 需要和 LC.80.Remove Duplicates from Sorted Array II 对比参考 阅读全文
posted @ 2018-04-16 23:50 davidnyc 阅读(101) 评论(0) 推荐(0) 编辑
摘要: s3 是用来存放sort 结果的,整个算法非常像 selection sort/bubble sort 1: 每次从s1中选出最小的一个放在s3 中,其他非最小的放入s2 中 2: 然后把s2 的数字放回到s1 中 循环结束后,s3 中的就是sort 好的结果 阅读全文
posted @ 2018-04-06 07:57 davidnyc 阅读(773) 评论(0) 推荐(0) 编辑
摘要: Repeatedly remove all adjacent, repeated characters in a given string from left to right.No adjacent characters should be identified in the final string.Examples"abbbaaccz" → "aaaccz" → "ccz" → "z""aa... 阅读全文
posted @ 2018-04-06 04:51 davidnyc 阅读(451) 评论(0) 推荐(0) 编辑
摘要: Determine if a small string is a substring of another large string.Return the index of the first occurrence of the small string in the large string.Return -1 if the small string is not a substring of ... 阅读全文
posted @ 2018-04-06 03:40 davidnyc 阅读(194) 评论(0) 推荐(0) 编辑
摘要: Remove adjacent, repeated characters in a given string, leaving only one character for each group of such characters.AssumptionsTry to do it in place.Examples“aaaabbbc” is transferred to “abc”Corner C... 阅读全文
posted @ 2018-04-05 12:43 davidnyc 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Given a string, remove all leading/trailing/duplicated empty spaces.Assumptions:The given string is not null.Examples:“ a” --> “a”“ I love MTV ” --> “I love MTV” 1 public String removeSpaces(... 阅读全文
posted @ 2018-04-05 12:14 davidnyc 阅读(262) 评论(0) 推荐(0) 编辑
摘要: Remove given characters in input string, the relative order of other characters should be remained. Return the new string after deletion.AssumptionsThe given input string is not null.The characters to... 阅读全文
posted @ 2018-04-05 09:05 davidnyc 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Given an integer array of size N - 1, containing all the numbers from 1 to N except one, find the missing number.AssumptionsThe given array is not null, and N >= 1ExamplesA = {2, 1, 4}, the missing nu... 阅读全文
posted @ 2018-04-05 07:15 davidnyc 阅读(166) 评论(0) 推荐(0) 编辑