自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

ForLearning

A man in the road!

  • 博客(37)
  • 资源 (3)
  • 收藏
  • 关注

原创 Binary Tree Zigzag Level Order Traversal

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 binary

2014-05-30 20:50:42 2976

原创 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: Recursive solution is t

2014-05-30 20:01:03 1035

原创 iostream迭代器

c++ primer 第四版

2014-05-29 20:39:33 863

原创 插入迭代器

C++提供了三种迭代器:(1)

2014-05-29 20:02:29 1110

原创 Reorder List

Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,3,4}, reorder it to {1,4

2014-05-27 20:42:10 719

原创 Linked List Cycle II

Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?

2014-05-27 19:27:11 653

原创 Linked List Cycle

Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Have you b

2014-05-27 17:07:32 706

原创 Copy List with Random Pointer

A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list.题目yao

2014-05-27 16:19:36 2443

原创 Deep copy(深拷贝)和shallow copy(浅拷贝)的区别

deep copy 和shallow copy 都是用于对象之间的拷贝,简单来说,如果

2014-05-24 18:03:41 11194

原创 Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.

2014-05-24 17:26:04 877

转载 9个offer,12家公司,35场面试,从微软到谷歌

1, 简介毕业答辩搞定,总算可以闲一段时间,把这段求职经历写出来,也作为之前三个半月的求职的回顾。 首先说说我拿到的offer情况:1) 微软,3面->终面,搞定(+1)2) 百度,3面->终面,口头offer(+1)3) 搜狗,2面,悲剧4) 腾讯,1面,悲剧5) 布丁移动,3面,搞定(+1)6) 涂鸦游戏,3面,搞定(+1)

2014-05-23 22:12:54 3302

原创 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 space. You m

2014-05-23 19:59:32 1406

原创 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 end, the

2014-05-23 19:46:25 678

原创 Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.循环列表应用

2014-05-23 19:29:08 749

原创 Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->1->1

2014-05-23 18:35:21 857

原创 Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.henjianda

2014-05-23 16:14:46 846

原创 Partition List

Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in each of t

2014-05-23 15:59:54 633

原创 Reverse Linked List II

Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,return 1->4->3->2->5->NULL.Note:Given m, n satisfy the fol

2014-05-22 23:24:03 553

原创 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 digit. Add the two numbers and return it as a link

2014-05-22 21:02:56 632

原创 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:Elements

2014-05-21 22:58:38 990

原创 子集法NFA转DFA

词法分析中zhongyao

2014-05-21 00:40:10 10550 1

原创 3Sum 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 have exact

2014-05-20 00:00:05 837

原创 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 triplet (a,b,c)

2014-05-19 19:44:39 884

原创 javascript的alert box在java中显示多行问题

如果直接在javascript代码中,显示多行直接加\n就好了:

2014-05-17 11:07:46 2876

原创 java变量和javascript变量之间的传递

最近在用jsp做一个网站,其间涉及到java变量和javascriptbianlang

2014-05-16 15:33:46 4092

原创 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 such that they add up to the target, whe

2014-05-14 23:27:55 714

原创 Symmetric Tree

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 3But the f

2014-05-14 21:10:51 704

原创 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 value.判断两棵树是否x

2014-05-14 20:07:26 711

原创 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,#,#,15,7},

2014-05-14 19:24:48 1327

原创 Binary Tree Level Order Traversal

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 20

2014-05-14 18:59:52 6689 2

原创 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: Recursive solutio

2014-05-13 17:05:22 796

原创 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 \ 2 / 3return [1,2,3].Note: Recursive soluti

2014-05-13 16:41:02 730

原创 二叉树遍历(递归和非递归)及应用

二叉树的遍历方法主要有qianxubianl

2014-05-10 23:20:18 1620

原创 广义表法建立二叉树

一直以来对树稍微存在一点儿恐惧感,最近打算好好顺yi

2014-05-10 17:03:51 4979

原创 Longest Consecutive Sequence

Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longest consecutive elements sequence is [1, 2, 3

2014-05-08 16:25:33 2311

原创 Median of Two Sorted Arrays

There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).

2014-05-06 16:52:35 876

原创 Search in Rotated Sorted Array

Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the array retur

2014-05-02 15:52:40 740

ibsvm-3.1-[FarutoUltimate3.1Mcode

libsvm很有用的工具包

2016-06-02

python模拟登陆新浪微博

用python实现了新浪微博的模拟登陆,新浪微博各种加密,各种跳转,详细分析登陆过程并实现!

2015-09-25

异常处理的两个实验代码

初学者异常处理可以参考这两个代码 对于高手就不用看了

2012-05-26

空空如也

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

TA关注的人

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