Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, ...
分类:
其他好文 时间:
2019-03-10 09:53:03
阅读次数:
121
c语言自然是应用最最著名的kmp(看毛片)算法。 这个算法的理解可以参考: https://www.cnblogs.com/yjiyjige/p/3263858.html python: python是真的简单,运用切片就能达到想要的目的了。 ...
分类:
编程语言 时间:
2019-03-08 09:49:26
阅读次数:
185
这里判断如果数组为空,那么返回长度为0. 设置一个length变量为0,用于记录不同值的个数。 在数组中循环,如果循环到的值不等于num[length] 实际上可以理解为 num[length]为数组的第一个数,找到和第一个数不同的数,就把length+1 然后把数存放到num[length+1]中 ...
分类:
编程语言 时间:
2019-03-08 09:36:57
阅读次数:
147
这道题和删除数组中重复的元素类似。依旧是类似双指针的操作,如果和val不等的话,就存入设的length指针数组中。 python: ...
分类:
编程语言 时间:
2019-03-08 09:36:19
阅读次数:
145
Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, ...
分类:
其他好文 时间:
2019-03-04 09:23:18
阅读次数:
163
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example 1: Example 2: ...
分类:
其他好文 时间:
2019-03-02 13:43:04
阅读次数:
200
題目 : Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extr ...
分类:
编程语言 时间:
2019-02-26 00:39:53
阅读次数:
227
Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not conta ...
分类:
其他好文 时间:
2019-02-24 17:29:57
阅读次数:
166
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra spa ...
分类:
其他好文 时间:
2019-02-20 20:01:55
阅读次数:
176
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. ...
分类:
其他好文 时间:
2019-02-18 01:20:29
阅读次数:
163