自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Validate Binary Search Tree

题目Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the node's

2013-07-17 14:07:00 1349

原创 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.思路一:最原始的 Bru

2013-07-15 21:16:27 1118

原创 澳大利亚参加学术会议签证申请

护照如果还没有护照,建议要提前准备了。因为至少需要15天才能拿到(办理之后的10个工作日可拿到,所以是15天左右)。当然如果在网上提前预约(北京市公安局) ,先填好护照申请表,可以提前两个工作日网上先查到你的护照号。当然网上预约再去办理(海淀区地址是:西钓鱼台地铁站下A口出,左手边50米处的中关村创新科技园区三楼)。签证申请最近要去参加澳大利亚的ICIP2013会议,特意整理了

2013-07-07 20:45:10 8294 1

原创 游戏类别

即时战略游戏(Real-Time Strategy Game)简称RTS。游戏是策略游戏(Strategy Game)的一种,主要以电脑游戏的形式存在。游戏是即时进行的,而不是策略游戏多见的回合制。另外玩家在游戏中经常会扮演将军,进行调兵遣将这种宏观操作。游戏进行一般来说,大多数即时战略游戏包含如下的步骤:利用工兵或MCV(Worker,或者称“农民”)来建设基地。利用

2013-07-30 10:39:05 1813

原创 游戏开发中的技术统计

2D游戏中障碍物判定平滑动画在游戏中,通过增加确定的位移来改变某个事物的位置往往是不准确的,也会导致画面不流畅。但是思考这种抖动产生的原因,我们可以受到很多启发,我们是不是可以减少每次移动的距离,而增加移动的频率来达到同样的位置呢?这样就可以大大降低画面的违和感,而最高的频率也就是和画面绘制的频率一致了,因此我们可以在每次绘制画面的时候进行较小幅度的更新,而为了摆脱两次绘制之间的时

2013-07-29 21:57:34 1685

原创 游戏中的人工智能(游戏AI)

游戏AI包含一切,从简单的追逐和闪躲,到移动模式,以及神经网络和遗传算法。无论采取何种手段,只要能给人以某种智能程度的“错觉”,让游戏更令人沉迷于其中,更具有挑战性,最重要的就是好玩,那才看做是游戏AI。定性AI定性行为或其表现是特定的,而且可预测,没有不确定性。如简单追逐算法。非定性AI某种程度的不确定性,有点不可预测性。具体实现是

2013-07-29 19:14:34 2239

原创 Multiply Strings

题目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.思路最后要对结果进行校正,因为有可能 result[i]>

2013-07-29 13:11:24 879

原创 Merge k Sorted Lists

题目Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 思路K 路归并链表;注意:不能用 ListNode *cur 来记录当前的链表节点(因为这样的话无法修改数组中的链表),而是要直接在数组中修改链表,所以要用 index 记录要修

2013-07-29 12:21:24 1042

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

2013-07-29 00:27:38 857

原创 Divide Two Integers

题目 Divide two integers without using multiplication, division and mod operator. 思路(1)被除数÷除数 = 商(2)直接用除数去一个一个加(或被除数一个一个减),直到被除数被超过的话,会超时。(3)其实我们可以加快除数的增加进程,每次翻一番,即每次将除数增加1倍,同时将 count 也增加一倍,

2013-07-28 23:58:00 1022

原创 Anagrams

题目Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.思路anagram:由颠倒字母顺序而构成的字(短语) 或 重新排列字母顺序构成一个新词 .例如:"tea" 和 "eat" 就是 anagram .

2013-07-28 23:23:20 1151

原创 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.一维数组旋转类似于一维数组旋转问

2013-07-28 22:58:54 857

原创 Edit Distance

题目:Edit Distance (链接地址)Definition of  Minimum Edit Distance Edit Distance 用于衡量两个strings之间的相似性。两个strings之间的 Minimum edit distance 是指把其中一个string通过编辑(包括插入,删除,替换操作)转换为另一个string的最小操作数。如上图所示

2013-07-28 21:39:20 1204

原创 Maximal Rectangle

题目Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.思路遍历,不断更新最大值。class Solution {public: int maximalRectangle(vector

2013-07-28 19:56:26 848

原创 Gray Code

题目The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence

2013-07-28 18:12:24 952

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

2013-07-28 17:34:05 1221

原创 Unique Binary Search Trees

题目Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2

2013-07-28 16:29:51 779

原创 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 bin

2013-07-28 16:14:24 724

原创 Construct Binary Tree from Inorder and Postorder Traversal

题目Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.通过中序和后序遍历的结果重建二叉树思路主要是确定 中序遍历 和后序遍历的对应范围。首

2013-07-28 15:53:03 1124

原创 Rotate Image

题目You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路将矩阵选择 90 度,即将矩阵按对角线分成 4 部分,交换每一部分的对应位置。

2013-07-27 23:14:09 736

原创 Decode Ways

题目A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the to

2013-07-27 22:27:35 688

原创 Integer to Roman

题目Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.思路基本字符:I、V、X、L、C、D、M相应的阿拉伯数字表示为:1、5、10、50、100、500、1000倍基本数字Ⅰ、X 、C 中的任何一个,自身连

2013-07-27 21:01:11 1021

原创 Wildcard Matching

题目Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should

2013-07-27 00:02:28 2281

原创 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 entire

2013-07-26 23:37:54 829

原创 Interleaving String

题目Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aa

2013-07-26 17:28:55 743

原创 Permutation Sequence

题目The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):"123""

2013-07-26 15:50:16 1175

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

2013-07-26 14:40:10 951

原创 Word Search

题目Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertical

2013-07-25 21:58:50 840

原创 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 timeEach int

2013-07-25 18:22:50 964

原创 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 = "a

2013-07-25 14:34:51 1011

原创 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 [

2013-07-25 14:10:13 1078

原创 String to Integer (atoi)

题目Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possi

2013-07-23 22:53:36 899

转载 Minimum Window Substring [从O(N*M),O(NlogM) 到O(N)]

链接Minimum Window Substring 1 [从O(N*M), O(NlogM)到O(N),人生就是一场不停的战斗]题目Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).F

2013-07-23 21:11:00 1191

原创 Minimum Window Substring

题目Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODEBANC"T = "ABC"Minimum window is "BAN

2013-07-23 20:31:58 1043

原创 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 NA

2013-07-23 15:05:45 780

原创 Longest Valid Parentheses

题目Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring i

2013-07-23 13:04:42 759

原创 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 "one 1" or 11.11 is read off as "two 1s" or 21.21 i

2013-07-22 23:35:40 1304 1

原创 Length of Last Word

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

2013-07-22 18:56:21 799

原创 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:"((()))", "(()())", "(())()", "()(())",

2013-07-22 17:08:48 757

原创 Interleaving String

题目判断两个字符串 s1 和 s2 是否可以拼接出 s3Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return

2013-07-22 16:31:51 788

空空如也

空空如也

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

TA关注的人

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