自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

小菜鸟的博客

慢慢积累吧女汉子

  • 博客(60)
  • 收藏
  • 关注

转载 Merge k Sorted Lists(hard)

【题目】     Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.【题意】    归并k个有序列表【分析】【实现】

2016-05-31 15:39:31 288

原创 Merge Two Sorted Lists(easy)

【题目】       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-05-31 15:23:46 219

原创 Populating Next Right Pointers in Each Node II (hard)

【题目】Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution still work?Note:You may only use const

2016-05-31 10:01:54 251

原创 Populating Next Right Pointers in Each Node(medium)

【题目】Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointer to point to its next right node

2016-05-31 09:43:01 235

转载 Flatten Binary Tree to Linked List(medium)

【题目】   Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened tree should look like:

2016-05-30 16:24:11 204

转载 Balanced Binary Tree

[题目]Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees ofevery node neve

2016-05-27 17:00:25 194

原创 Symmetric Tree(easy)

【题目】 Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3

2016-05-26 18:06:16 281

原创 Binary Tree Level Order Traversal II

【题目】Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree {3,9,20,#

2016-05-26 17:55:49 214

原创 css之position属性

正确的使用DIV布局属性之position属性Position的英文原意是指位置、职位、状态。也有安置的意思。在CSS布局中,Position发挥着非常重要的作用,很多容器的定位是用Position来完成。Position属性有四个可选值,它们分别是:static、absolute、fixed、relative。我们下面来共同学习它们的不同的用法,在学习中我们应该去思考在什么布局情

2016-05-26 15:00:32 427

原创 Binary Tree Level Order Traversal (easy)

【题目】Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9 2

2016-05-26 10:22:24 225

原创 Binary Tree Zigzag Level Order Traversal(medium)

[题目]Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).For example:Given b

2016-05-26 09:53:58 370

转载 ubuntu 安装 navicat

http://hi.baidu.com/fiveview/item/926f2ac05136ae35ea0f2e9c安装:1,官方下载: http://www.navicat.com/en/download/download.html2,下载后 解压tar文件tar -zxvf navicat8_mysql_en.tar.gz3,解压后进入解压后

2016-05-25 10:11:01 526

原创 Maximum Depth of Binary Tree(easy)

【题目】  Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Subscribe to see which compa

2016-05-25 08:51:31 204

原创 Path Sum II(medium)

[题目]   Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22, 5 /

2016-05-25 08:15:33 282

原创 Path Sum

【题目】Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tre

2016-05-24 09:45:49 206

原创 Sum Root to Leaf Numbers

【题目】       Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.

2016-05-24 09:30:57 197

原创 Construct Binary Tree from Inorder and Postorder Traversal(medium)

【题目】            Given inorder and postorder traversal of a tree, construct the binary tree.      Note:      You may assume that duplicates do not exist in the tree.【题意】    根据中序和后序遍历结果构

2016-05-23 10:35:52 245

转载 Construct Binary Tree from Preorder and Inorder Traversal (medium)

【题目】        Given preorder and inorder traversal of a tree, construct the binary tree.    Note:    You may assume that duplicates do not exist in the tree.【题意】  根据先序遍历和中序遍历创建二叉树即

2016-05-23 10:24:14 352

原创 Binary Tree Postorder Traversal

【题目】 Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,1].Note: Recu

2016-05-20 09:46:54 221

原创 Binary Tree Inorder Traversal

【题目】 Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,3,2].Note: Recurs

2016-05-20 09:35:31 256

原创 String的hashcode(java)

hashCode就是我们所说的散列码,使用hashCode算法可以帮助我们进行高效率的查找,例如HashMap,说hashCode之前,先来看看Object类。我们知道,Object类是java程序中所有类的直接或间接父类,处于类层次的最高点。在Object类里定义了很多我们常见的方法,包括我们要讲的hashCode方法,如下 Java代码  pub

2016-05-19 11:42:53 1073

转载 <meta>标签

meta是用来在HTML文档中模拟HTTP协议的响应头报文。meta 标签用于网页的与中,meta 标签的用处很多。meta 的属性有两种:name和http- equiv。name属性主要用于描述网页,对应于content(网页内容),以便于搜索引擎机器人查找、分类(目前几乎所有皼br /> ?搜索引擎都使用网上机器人自动查找meta值来给网页分类)。这其中最重要的是description(站点

2016-05-19 10:52:07 511

原创 Binary Tree Preorder Traversal

【题目】                      Given a binary tree, return the preorder traversal of its nodes' values.           For example:          Given binary tree {1,#,2,3}, 1 \

2016-05-18 18:22:54 199

原创 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 structurally identical and the nodes have the same

2016-05-18 18:20:49 209

转载 GlassFish 理解

一:安装下载:     必须预先安装Jdk,并且设置JAVA_HOME环境变量。从官网下载GlassFish ,是一个jar文件。下载后运行:F:\>java -Xmx256m -jarglassfish-installer-v2ur2-b04-windows.jar如果这里不加上-Xmx256m,很有可能会报OutOfMemoryException。这个命令会产生一个名为glassf

2016-05-18 18:03:55 651

原创 Length of Last Word(easy)

【题目】   Given a string s consists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A w

2016-05-17 18:23:08 227

转载 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

2016-05-17 18:21:21 242

转载 Longest Palindromic Substring(medium 常考)

【题目】        Given a string S, find the longest palindromic substring inS. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.【题意】

2016-05-17 17:37:44 229

原创 windows下安装sass(遇到的问题)

注意:sass依赖于ruby环境,所以安装sass之前得先安装ruby,然后安装gem类似于linux的yum 管理包。1:在命令行中输入gem install sass          幸运的话会看到:           可是一般会遇到:           或者:      错误的大概意思是路径被墙掉了,可以加上一个国内的库。之前解决

2016-05-17 11:26:48 481

原创 ruby安装步骤

1. 安装ruby      在window环境下可以利用ruby安装工具rubyinstaller,这个安装工具可以很方便地安装ruby解释器,rubyinstaller可以从 http://rubyinstaller.org/downloads/网站上下载。安装的过程中,有几个辅助选项,如是否将安装路径添加到环境变量中等。说明的是安装路径中不要有空格,否则会影响rails的安装。

2016-05-17 10:46:18 5305

原创 Multiply Strings(medium)

【题目】        Given two numbers represented as strings, return multiplication of the numbers as a string.   Note:The numbers can be arbitrarily large and are non-negative.Converting the inpu

2016-05-16 15:52:04 323

原创 Valid Palindrome(easy)

【题目】      Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.         For example,       "A man, a plan, a canal: Panama" is a

2016-05-16 15:03:14 200

原创 Reverse Vowels of a String (easy)

【题目】      Write a function that takes a string as input and reverse only the vowels of a string.      Example 1:      Given s = "hello", return "holle".      Example 2:      Given s = "lee

2016-05-15 09:53:01 336

原创 Reverse String(easy)

【题目】                 Write a function that takes a string as input and returns the string reversed.           Example:            Given s = “hello”, return “olleh”. 【题意】        字符串反转 【分析

2016-05-15 09:35:49 239

原创 Valid Anagram(easy)

【题目】           Given two strings s and t, write a function to determine ift is an anagram of s.            For example,                   s = "anagram", t = "nagaram", return true.

2016-05-15 09:13:29 217

原创 anagrams(medium)

【题目】Given an array of strings, group anagrams together.For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return:[ ["ate", "eat","tea"], ["nat","tan"], ["bat"]]Note:

2016-05-15 08:30:34 273

原创 找链表中倒数第K个结点

【题目】:输入一个链表,输出该链表中倒数第K个结点。为了符合大多数人的习惯,本题从1开始计数,即链表的尾结点是倒数第1个结点。例如一个链表有6个结点,从头结点开始它们的值依次是1、2、3、4、5、6。这个链表的倒数第3个结点是值为4的结点。【思路】: 方法1:遍历两次链表即先算出链表的长度n,然后倒数第k个结点就是顺序的第(n-k+1)个数。            方法

2016-05-14 11:20:03 434

原创 单链表的反转

【题目】单链表的反转【方法】   1:可以将单链表的data储存为数组,之后可以按数组的索引逆序进行反转。(一般不适用,浪费空间)              2:利用三个指针遍历单链表,逐个链接点进行反转。              3:从第2个节点到第N个节点,依次逐节点插入到第1个节点(head节点)之后,最后将第一个节点挪到新表的表尾。方法二: 定义p,q,r三个指针

2016-05-14 10:40:43 338

原创 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-05-14 09:48:59 256

原创 Restore IP Addresses

【题目】Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given "25525511135",return ["255.255.11.135", "255.255.111.35"]. (Orde

2016-05-14 08:42:46 232

空空如也

空空如也

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

TA关注的人

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