自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(44)
  • 收藏
  • 关注

转载 [leetcode] 107. Binary Tree Level Order Traversal II

[leetcode] 107. Binary Tree Level Order Traversal II题目链接:https://leetcode.com/problems/binary-tree-level-order-traversal-ii/Given a binary tree, return the bottom-up level order traversal of its nodes’

2018-01-03 17:40:09 187

转载 [leetcode] 104. Maximum Depth of Binary Tree

[leetcode] 104. Maximum Depth of Binary Tree题目链接:https://leetcode.com/problems/maximum-depth-of-binary-tree/Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along th

2018-01-03 17:16:12 190

转载 [Leetcode] 101.Symmetric Tree

[leetcode] 101. Symmetric Tree题目链接:https://leetcode.com/problems/symmetric-tree/Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tr

2018-01-03 17:05:47 197

转载 [Leetcode] 100.Same Tree

[leetcode] 100. Same Tree题目链接:https://leetcode.com/problems/same-tree/Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are struct

2017-12-25 18:57:11 212

转载 [Leetcode] 88.Merge Sorted Array

[leetcode] 88. Merge Sorted Array题目链接:https://leetcode.com/problems/merge-sorted-array/Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: You may assume

2017-12-25 18:55:59 158

转载 [Leetcode]83.Remove Duplicates from Sorted List

[leetcode] 83. Remove Duplicates from Sorted List题目连接:https://leetcode.com/problems/remove-duplicates-from-sorted-list/Given a sorted linked list, delete all duplicates such that each element appear on

2017-12-25 18:48:32 142

转载 [Leetcode]70.Climbing Stairs

[leetcode] 70. Climbing Stairs题目链接:https://leetcode.com/problems/climbing-stairs/You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how

2017-12-25 18:46:11 202

转载 [Leetcode]69.Sqrt(x)

[leetcode] 69. Sqrt(x)题目链接:https://leetcode.com/problems/sqrtx/Implement int sqrt(int x).Compute and return the square root of x.思路二分查找,每次看中间的数平方是不是和当前数相等.class Solution {public: int mySqrt(int x)

2017-12-25 18:43:35 193

转载 [Leetcode]67.Add Binary

[leetcode] 67. Add Binary题目链接:https://leetcode.com/problems/add-binary/Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”.字符串相加class Solutio

2017-12-25 18:42:22 153

转载 [Leetcode]66.Plus One

[leetcode] 66. Plus One题目链接:https://leetcode.com/problems/plus-one/Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most signifi

2017-12-25 18:40:17 141

转载 [leetcode]58 Length of Last Word

[leetcode] 58. Length of Last Word题目连接:https://leetcode.com/problems/length-of-last-word/Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of las

2017-12-25 18:38:33 160

转载 [Leetcode] 53--Maximum Subarray

[leetcode] 53. Maximum Subarray题目链接:https://leetcode.com/problems/maximum-subarray/Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, g

2017-12-25 18:36:39 162

转载 [Leetcode]38--Count and Say

[leetcode] 38. Count and Say题目链接:https://leetcode.com/problems/count-and-say/The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, …1 is read off as “on

2017-12-25 18:34:12 162

转载 [leetcode] 35. Search Insert Position

题目链接:https://leetcode.com/problems/search-insert-position/Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserte

2017-12-18 09:40:26 141

转载 文本数据挖掘之文本信息抽取

题目链接:https://leetcode.com/problems/search-insert-position/Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserte

2017-12-18 09:39:17 7311

转载 文本挖掘之文本分类

文本分类介绍文本分类问题是根据文本的特征将其分到预先设定好的类别中,类别可以是两类,也可以是更多的类别。文本分类是机器学习领域里监督学习的一种重要应用问题。不过需要指出的是,第一,文本分类问题中用于构建文本自动分类系统的文本类别体系是已经确定的。类别系统一旦变化,需要重新构建新的文本分类系统;第二,在文本分类问题中,并没有特别要求一篇文本只能属于某一个类别,例如,根据主题的分类中每篇文本可能会

2017-12-18 09:37:43 1545

转载 [leetcode] 28. Implement strStr()

思路找一个字符串中是否包含另一个字符串,并返回其位置。按照复杂的做那么就是KMPclass Solution {public: int strStr(string haystack, string needle) { int i = -1,len1 = haystack.size(),len2 = needle.size(); while(++i <= le

2017-12-17 15:33:03 189

转载 [leetcode] 27. Remove Element

题目链接:https://leetcode.com/problems/remove-element/Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn’t matt

2017-12-17 15:21:59 142

转载 [leetcode] 26. Remove Duplicates from Sorted Array

题目链接:https://leetcode.com/problems/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.Do not allo

2017-12-17 15:14:29 144

转载 [leetcode] 21. Merge Two Sorted Lists

题目链接:https://leetcode.com/problems/merge-two-sorted-lists/Merge 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.思路

2017-12-17 15:03:51 151

转载 [leetcode] 20. Valid Parentheses

题目链接:https://leetcode.com/problems/valid-parentheses/Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The brackets must close in the

2017-12-17 11:09:44 172

转载 [leetcode] 14. Longest Common Prefix[leetcode] 14. Longest Common Prefix

题目链接:https://leetcode.com/problems/longest-common-prefix/Write a function to find the longest common prefix string amongst an array of strings.思路每次子串长度加1,直到子串不相等即是最大公共前缀class Solution {public: str

2017-12-17 10:56:55 144

转载 [leetcode] 13. Roman to Integer

题目链接:https://leetcode.com/problems/roman-to-integer/Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.思路罗马数字总共有七个 即I(1)、V(5)、X(10)、L(50)、C(100)、

2017-12-17 10:48:20 144

转载 [leetcode] 9. Palindrome Number

题目链接:https://leetcode.com/problems/palindrome-number/Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers. Some hints:Could negative integers be palindromes

2017-12-17 10:38:45 191

转载 [leetcode] 7. Reverse Integer

题目链接:https://leetcode.com/problems/reverse-integer/Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321思路注意溢出情况处理class Solution {public: int reverse(int x) {

2017-12-17 10:22:50 124

转载 [leetcode] 6. ZigZag Conversion

题目链接:https://leetcode.com/problems/zigzag-conversion/The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed fon

2017-12-17 10:07:14 122

转载 TensorFlow(一):基本操作

配置TensorFlow,官方教程:https://www.tensorflow.org/get_started/os_setup 安装了GPU版本的TensorFlow,还需要配置Cuda,关于Cuda安装看这里:https://www.tensorflow.org/get_started/os_setup#optional-install-cuda-gpus-on-linux 还需要一个Py

2017-12-16 20:51:45 232

转载 DL学习--GAN

简介生成式对抗网络,主要介绍三篇论文:1)Generative Adversarial Networks;2)Conditional Generative Adversarial Nets;3)Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks。第一篇论文GAN的过程

2017-12-16 19:30:35 452

转载 [leetcode] 5. Longest Palindromic Substring

题目链接:https://leetcode.com/problems/longest-palindromic-substring/Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one

2017-12-15 10:29:21 152

转载 [leetcode] 4. Median of Two Sorted Arrays

题目链接: https://leetcode.com/problems/median-of-two-sorted-arrays/There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run tim

2017-12-15 09:48:13 124

转载 [leetcode] 3. Longest Substring Without Repeating Characters

题目链接:https://leetcode.com/problems/longest-substring-without-repeating-characters/Given a string, find the length of the longest substring without repeating characters. For example, the longest substri

2017-12-15 08:36:19 136

转载 KMP算法

解决问题类型字符串匹配算法说明一般匹配字符串时,我们从目标字符串str(假设长度为n)的第一个下标选取和ptr长度(长度为m)一样的子字符串进行比较,如果一样,就返回开始处的下标值,不一样,选取str下一个下标,同样选取长度为n的字符串进行比较,直到str的末尾(实际比较时,下标移动到n-m)。这样的时间复杂度是O(n*m)。KMP算法:可以实现复杂度为O(m+n)为何简化了时间复杂度: 充分利用

2017-12-15 00:09:51 528

转载 数据结构--字符串

字符串与子串、子序列C/C++标准库提供的字符串处理函数 strlen() 返回s的长度,不包括字符串结束符null strcmp(s1,s2) 比较两个字符串s1和s2是否相同。若s1与s2星等,返回1,若s1大于s2,返回整数,若s1小于s2,则返回负数 strcat(s1,s2) 将字符串s2连接到s1后,并返回s1 strcpy(s1,s2) 将s2复制给s1,

2017-12-15 00:00:06 307

转载 面试-剑指offer-数组中出现次数超过一半的数字

题目数组中有一个数字出现的次数超过数组长度的一般,请找出这个数字。思路解法一:基于Partition函数的O(n)算法数组中有一个数字出现的次数超过了数组长度的一般。如果把这个数组排序,那么排序之后位于数组中间的数字一定就是那个出现次数超过数组长度一半的数字。也就是说,这个数字就是统计学上的中位数,即长度为n的数组中第n/2大的数字。我么有成熟的O(n)的算法得到数组中任意第k大的数字。快速排

2017-12-14 21:58:21 174

转载 面试--求数组,左边的数都小于等于它,右边的数都大于等于它

题目在一个 int 数组里查找这样的数,它大于等于左侧所有数,小于等于右侧所有数。直观想法是用两个数组 a、b。a[i]、b[i]分别保存从前到 i 的最大的数和从后到 i 的最小的数,一个解答:这需要两次遍历,然后再遍历一次原数组,将所有 data[i]>=a[i-1]&&data[i]<=b[i]的 data[i]找出即可。给出这个解答后,面试官有要求只能用一个辅助数组,且要求少遍历一次。

2017-12-14 19:04:44 2777

转载 [Leetcode]2.Add Two Numbers

题目链接:https://leetcode.com/problems/add-two-numbers/You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single

2017-12-14 13:38:22 145

转载 Hash算法原理

散列表,它是基于高速存取的角度设计的,也是一种典型的“空间换时间”的做法。顾名思义,该数据结构能够理解为一个线性表,可是当中的元素不是紧密排列的,而是可能存在空隙。 散列表(Hash table,也叫哈希表),是依据关键码值(Key value)而直接进行訪问的数据结构。也就是说,它通过把关键码值映射到表中一个位置来訪问记录,以加快查找的速度。这个映射函数叫做散列函数,存放记录的数组叫做散列表。

2017-12-13 19:07:31 178

转载 [leetcode]1.Two Sum

题目链接:https://leetcode.com/problems/two-sum/Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers su

2017-12-13 18:57:42 153

转载 数组

数组是一种数据格式,能够存储多个同类型的值,以为数组可用来实现线性表的顺序存储、哈希表等,二维数组可用来保存图的邻接矩阵等。一维数组的声明与字符数组 1.1一维数组的声明与初始化 1.一维数组的声明 一维数组声明应指出以下三点: 1)存储在每个元素中的值的类型; 2)数组名; 3)数组中的元素数,数组的元素必须用值大于等于1的常量表达式定义。 数组定义中的类型可以是内置数据类型或类类

2017-12-13 18:03:17 159

转载 程序设计基础及数据结构基础

基本概念C++内置类型 内置的C++类型分两组,基本类型和复合类型。基本类型保罗整数、浮点数及两者的多种变体。复合类型包括数组、字符串、指针、引用、结构体和共用体等。C++的基本整型 按宽度递增的顺序排列,分别是char、short(也可称为短整型)、int(也可称为整型)和long(也可称为长整型),其中每种类型都有无符号版本和有符号版本。内存分区 1)堆:由程序员手动分配和释放,完全

2017-12-13 17:21:18 465

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除