自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 MySQL学习笔记----子查询、联结表、组合查询、全文本搜索

联结:一种机制,用来在一条SELECT语句中关联表,因此称之为联结。它在数据库中不存在。联结由MySQL根据需要建立,它存在于查询的执行过程中。创建联结:(使用WHERE联结)SELECT vend_name, prod_name, prod_priceFROM vendors, productsWHERE vendors.vend_id = products.ve

2016-04-21 22:17:45 1148

原创 LeetCode之24----Swap Nodes in Pairs

题目:Given 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 use only constant

2016-04-21 19:08:23 1726

原创 LeetCode之23---Merge k Sorted Lists

题目:  Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.题目大意:  给定k条有序链表,求k条链表有序合并后的链表。思路:  看到这道题感觉蛮亲切的,因为已经不止一次遇到链表有序合并的问题了,所以思路还是有的。  第一

2016-04-20 23:43:45 800

原创 LeetCode之22----Generate Parentheses

题目:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(()

2016-04-20 19:57:17 1142

原创 LeetCode之21----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.题目大意:  给定两个有序的链表,求有序合并后的链表。思路:  链表有序合并也是

2016-04-17 16:59:54 3365

原创 LeetCode之20---Valid Parentheses

题目:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are

2016-04-16 22:47:36 990

原创 LeetCode之19---Remove Nth Node From End of List

题目:Given 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 removing the second node from the e

2016-04-16 14:33:12 3195

原创 LeetCode之18---4Sum

题目:Given 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:

2016-04-16 00:00:20 1079

原创 MySQL学习笔记---基础概念和一些基础SQL语句(一)

MySQL学习笔记,以防遗忘数据库基本概念数据库:保存有组织的数据的容器(通常是一个文件或一组文件)。表:某种特定类型数据的结构化清单,数据库中的表都有一个唯一的名字用来标识自己。模式:关于数据库和表的布局及特性的信息。列:表中的一个字段。所有表都是由一个或多个列组成,每个列都有对应的数据类型。行:表中的一个记录。主键:一列(或一组列),其值能够唯一区分表中每个行(每条

2016-04-14 20:11:15 2701 1

原创 LeetCode之17----Letter Combinations of a Phone Number

题目:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input

2016-04-14 18:46:32 3375

原创 三角形数字问题

题目:  给定一个数字三角形,找到从顶部到底部的最大路径和。每一步可以移动到下面一行的相邻数字上。输入第一行数字n是三角形的行数,接下来的n行是数字三角形的每一行,如:   5   7   3 8   8 1 0   2 7 4 4   4 5 2 6 5  输出是 30思路:  1、递归+记忆法   用二维数组存储数字三角形中的每一行,不难发现,每个数

2016-04-13 17:06:55 856

原创 LeetCode之16----3Sums Closest

题目:Given 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 each input would hav

2016-04-12 19:14:02 1158

原创 LeetCode之15----3Sum

题目:Given 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:Elements in a tripl

2016-04-11 22:00:13 863

原创 字典序问题

题目:  字典序问题,给定一个长度不超过6的小写字母升序字符串(字符串中的字符相对顺序和字母表中的顺序一致),迅速计算出在字典中的编码,字典如:    1   2   3   ...     26  27  28  ...    a   b   c   ...      z    ab  ac  ...思路:      总体思路为先计算出给定字符串前所有的个数,然后再加一代

2016-04-10 23:03:53 852

原创 LeetCode之14---Longest Common Prefix

题目:  Write a function to find the longest common prefix string amongst an array of strings.题目大意:    写一个函数,求一个字符串数组中最长的公共前缀子串。思路:  在做这道题之前先要了解一下什么叫做公共前缀子串。在英语中一个单词可以分为前缀、词根、后缀三部分,所谓前缀就是指在单词的开

2016-04-10 14:21:28 2487

原创 LeetCode之13---Roman to Integer

题目:  Given a roman numeral, convert it to an integer.  Input is guaranteed to be within the range from 1 to 3999.题目大意:  给定一个罗马数字,将其转化为一个整数。转化好的整数的范围在1---3999之间。思路:  有了上一题的经验,我们可以将待转化的罗马数

2016-04-09 19:42:43 735

原创 LeetCode之12---Integer to Roman

题目:  Given an integer, convert it to a roman numeral.  Input is guaranteed to be within the range from 1 to 3999.题目大意:  输入一个整形数字,将其转化为罗马数字,范围在1--3999之间。思路:  在做此题之前特意谷歌了一下罗马数字是什么鬼,因为之前只认识

2016-04-09 15:49:41 2237

原创 LeetCode之11---Container With Most Water

题目:  Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i

2016-04-08 18:00:01 1323

原创 LeetCode之10 --- Regular Expression Matching

题目:  ,Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the ent

2016-04-07 20:22:49 986

原创 LeetCode之9---Palindrome Number

题目:  Determine whether an integer is a palindrome. Do this without extra space.题目大意:  判断一个数字是不是回文数,要求不是用额外的空间。思路:  最近的几道LeetCode的题很简单,答题思路就是将原数字翻转然后和原数相比较,如果相等则返回true,否则返回false。但是以前边几道题的尿性来看

2016-04-05 22:02:08 676

原创 LeetCode之8----String to Integer (atoi)

题目:  Implement atoi to convert a string to an integer.题目大意:  将一个数字字符串转化为整数数字,返回整数数字。思路:  初看本题觉得很简单,直接用一个循环进行转换就行了,循环里边的语句也很简单,就是result = result * 10 + s[i] - '0',但是提交之后就轰轰烈烈的错了。原来是因为我没有考虑各

2016-04-05 19:53:14 600

原创 LeetCode之7 --- Reverse Integer

题目:  Reverse digits of an integer.  Example1: x = 123, return 321  Example2: x = -123, return -321题目大意:逆置一个整数,如:123--->321   -123--->-321思路:  这道题比较简单,和回文数的解法一致,只不过比回文数少了一个判断而已。具体思路是循环执行r

2016-04-04 18:41:53 621

原创 LeetCode之6---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 font for better legibility)P A H

2016-04-04 15:19:39 614

原创 LeetCode 之 5 ---- 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 unique longest palindromic substring.大意:

2016-04-03 21:14:08 589

空空如也

空空如也

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

TA关注的人

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