自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 LeetCode124:Binary Tree Maximum Path Sum

题目: Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For example: Given the below binary tree, 1 / \ 2 3Retur...

2014-05-27 18:09:00 217

转载 LeetCode123:Best Time to Buy and Sell Stock III

题目: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most two transactions. Note: ...

2014-05-27 10:29:00 217

转载 LeetCode122:Best Time to Buy and Sell Stock II

题目: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie...

2014-05-26 20:25:00 232

转载 LeetCode121:Best Time to Buy and Sell Stock

题目: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the...

2014-05-26 20:04:00 166

转载 MyEclipse10修改servlet模版

Myeclipse10中servlet模版存放的位置与早些的版本不同,它存放在: MyEclipse\Common\plugins中的下面那个jar包中 com.genuitec.eclipse.wizards_9.0.0.me201108091322.jar 不用解压,直接用解压缩工具打开即可,然后在文件夹\templates中就可找到Servlet.java.转载于:htt...

2014-05-11 09:33:00 91

转载 MyEclipse10启动Tomcat8出错

问题一: java.lang.UnsupportedClassVersionError: org/apache/catalina/startup/Bootstrap : (Unsupported major.minor version 55.0) 原因是因为jdk版本太低了,tomcat8支持,更换更高级的jdk或者使用低版本的tomcat。 这里我将jdk换成jdk1.8: ...

2014-05-08 21:05:00 198

转载 Tomcat8访问管理页面localhost出现:403 Access Denied

问题: 403 Access DeniedYou are not authorized to view this page.If you have already configured the Manager application to allow access and you have used your browsers back button, used ...

2014-05-07 22:56:00 109

转载 LeetCode5: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. 解题思路: 主要有三种: ...

2014-05-01 13:22:00 122

转载 LeetCode4: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...

2014-04-29 14:07:00 99

转载 LeetCode3:Longest Substring Without Repeating Characters

题目: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length ...

2014-04-29 12:27:00 91

转载 LeetCode2: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-04-29 10:26:00 78

转载 LeetCode1: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 tar...

2014-04-28 10:53:00 78

转载 LeetCode127:Word Ladder II

题目: Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: Only one letter can be changed at a time Each intermediate w...

2014-04-28 09:41:00 105

转载 LeetCode126:Word Ladder

题目: Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: Only one letter can be changed at a time Each int...

2014-04-27 17:15:00 97

转载 LeetCode128: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...

2014-04-25 18:50:00 77

转载 LeetCode129: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. Fin...

2014-04-24 23:16:00 91

转载 LeetCode130:Surrounded Regions

题目: Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region. For example, X X X XX O O ...

2014-04-24 22:28:00 84

转载 LeetCode132:Palindrome Partitioning II

题目: Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning of s. For example, given s = "aab", ...

2014-04-24 20:48:00 96

转载 LeetCode131:Palindrome Partitioning

题目: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For example, given s = "aab", Return [ ...

2014-04-23 16:54:00 76

转载 2014腾讯实习生招聘武汉试题

注:以上图片来自网络,非常感谢拍照者提供附最后一提实现代码:#include<iostream>#include<iterator>#include<stack>using namespace std;int MaxArea(int *arr, int len){ if...

2014-04-09 16:04:00 116

转载 阿里巴巴集团2013实习生招聘技术类笔试卷(B)

一、单选题1、在常用的网络协议中,___是面向连接的、有重传功能的协议。A、IP B、TCP C、UDP D、DXP2、500张多米诺骨牌整齐地排成一列,依顺序编号为1、2、3……499、500。第一次拿走所有奇数位置上的骨牌,第二次再从剩余骨牌中拿走所有奇数位置上的骨牌,依此类推。请问最后剩下的一张骨牌的编号是多少?A、128 B、250 C...

2014-03-26 11:21:00 471

转载 LeetCode133:Clone Graph

题目:Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes are labeled uniquely.We use # as a separator fo...

2014-02-19 08:51:00 98

转载 LeetCode134:Gas Station

题目:There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station...

2014-02-18 22:02:00 80

转载 LeetCode135:Candy

题目:There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at ...

2014-02-18 20:47:00 86

转载 LeetCode137:Single Number II

题目:Given an array of integers, every element appears three times except for one. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you implement it with...

2014-02-18 16:49:00 61

转载 LeetCode136:Single Number

题目:Given an array of integers, every element appears twice except for one. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you implement it without us...

2014-02-18 16:24:00 66

转载 LeetCode138: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.解题思路:拷贝链表时,新节点的random指...

2014-02-18 16:03:00 89

转载 LeetCode140:Word Break II

题目:Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, given ...

2014-02-18 15:06:00 82

转载 LeetCode139:Word Break

题目:Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, given s = "leetcode", di...

2014-02-17 22:40:00 90

转载 LeetCode141: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?解题思路:判断链表有无环,可用快慢指针进行,快指针每次走两步,慢指针每次走一步,如果快指针追上了慢指针,则存在环,否则,快指针走到链表末尾即为NULL...

2014-02-17 19:20:00 84

转载 LeetCode142: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-02-17 19:14:00 92

转载 LeetCode143: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 ...

2014-02-17 16:26:00 82

转载 LeetCode144: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-02-17 15:43:00 67

转载 LeetCode145: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 solut...

2014-02-17 15:30:00 93

转载 LeetCode146:LRU Cache

题目:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of the...

2014-02-17 12:55:00 98

转载 LeetCode147:Insertion Sort List

题目:Sort a linked list using insertion sort.解题思路:按题目要求,直接进行插入排序实现代码:#include <iostream>using namespace std;/*Sort a linked list using insertion sort. */struct ListNod...

2014-02-17 09:57:00 97

转载 LeetCode148:Sort List

题目:Sort a linked list in O(n log n) time using constant space complexity.解题思路:根据题目要求,可知只能用归并排序,其他排序算法要么时间复杂度不满足,要么空间复杂度不满足实现代码:#include <iostream>using namespace std;/*S...

2014-02-16 23:39:00 52

转载 LeetCode150:Evaluate Reverse Polish Notation

题目:Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1",...

2014-02-16 22:14:00 74

转载 LeetCode151:Reverse Words in a String

题目:Given an input string, reverse the string word by word.For example, Given s = "the sky is blue", return "blue is sky the".Clarification:What constitutes a word? A se...

2014-02-16 22:08:00 102

转载 LeetCode149:Max Points on a Line

题目:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.解题思路:1,在所有点中选定一个点作为中心点,然后再求剩下的点到该中心点的斜率,如果斜率相同的点表示在同一直线上2,如果剩下点中有与中心点相同的点,则记下相同点的个数,然...

2014-02-16 22:03:00 101

空空如也

空空如也

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

TA关注的人

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