自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

(●—●)

科技?文艺:逗比!

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

翻译 FaceWarehouse: a 3D Facial Expression Database for Visual Computing

FaceWarehouse: a 3D Facial Expression Database for Visual ComputingIV.应用FaceWarehouse能被应用在多种视觉计算应用中。在这部分,我们展示4个实例应用:facial image manipulation,face component transfer,real-time performance-based facial

2015-06-29 20:23:53 6352 7

翻译 路径搜索之A*算法

翻译自:http://theory.stanford.edu/~amitp/GameProgramming/我们想要解决的问题是在游戏中从一个起点到达终点来获取一个游戏的目标。路径搜索就是处理这样从起点到终点寻找一条好路径的问题——避免障碍物和敌人,并且最小化成本(燃油,时间,距离,装备,钱财等)。移动处理跟踪一条路径并沿着它运动的问题。这两者只关注其一是可行的的。一种极端情况下,一个复杂的路径寻找

2015-06-15 14:42:36 894

原创 《剑指Offer》面试题33:把数组排成最小的数

//面试题33:把数组排成最小的数#include <iostream>#include <vector>#include <string>#include <sstream>#include <Windows.h>using namespace std;const int prec = numeric_limits<long double>::digits10;//模板函数:类型转换

2015-05-15 15:39:56 1004

原创 《CTCI》3.5 用两个栈实现队列

《CTCI》 P1423 栈与队列题目3.5 实现一个MyQueue类,该类用两个栈来实现一个队列。解答#include <stack>template <typename T> class queue{public: void push(const T& val); void pop(); const T& front(); const T& back();

2015-05-08 21:52:44 331

原创 《剑指Offer》面试题28:字符串的排列

《剑指Offer》 P154面试题28:字符串的排列题目解答//面试题28:字符串的全排列#include <string>#include <iostream>#include <Windows.h>using namespace std;void permutation(string s,int start,int &num){ if (start == s.size() - 1)

2015-05-08 16:19:51 1474

原创 LeetCode 80 Remove Duplicates from Sorted Array II

LeetCode80 Remove Duplicates from Sorted Array II题目Follow up for “Remove Duplicates”: What if duplicates are allowed at most twice?For example, Given sorted array nums = [1,1,1,2,2,3],Your function s

2015-05-08 16:15:15 305

原创 LeetCode 26 Remove Duplicates from Sorted Array

LeetCode26 Remove Duplicates from Sorted Array题目Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for an

2015-05-07 21:19:12 272

原创 《编程之美》2.1 求二进制中1的个数

《编程之美》 P119第2章 数字之谜——数字中的技巧2.1 求二进制中1的个数题目对于一个字节(8bit)的无符号整型变量,求其二进制表示中“1”的个数,要求算法的执行效率尽可能高。解答

2015-05-07 20:08:33 344

原创 《CTCI》3.4 汉诺塔游戏

《CTCI》 P1403 栈与队列题目3.4 In the classic problem of the Towers of Hanoi, you have 3 towers and N disks of different sizes which can slide onto any tower. The puzzle starts with disks sorted in ascending o

2015-05-07 17:05:18 440

原创 《剑指Offer》 面试题27:二叉搜索树与双向链表

《剑指Offer》 P151面试题27:二叉搜索树与双向链表题目输入一棵二叉搜索树,将该二叉搜索树转换成一个排序的双向链表。要求不能创建任何新的结点,只能调整树中结点指针的指向。

2015-05-07 14:38:58 420

原创 《剑指Offer》面试题26:复杂链表的复制

《剑指Offer》 P147面试题26:复杂链表的复制题目请实现函数ComplexListNode* Clone(ComplexListNode* pHead),复制一个复杂链表。在复杂链表中,每个结点除了有一个m_pNext指针指向下一个结点外,还有一个m_pSibling指向链表中的任意结点或者NULL。结点的C++定义如下:struct ComplexListNode{ int m_

2015-05-07 12:42:35 923

原创 LeetCode 36 Valid Sudoku

LeetCode36 Valid Sudoku题目Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character ‘.’.A parti

2015-05-04 15:53:17 324

原创 LeetCode 3 Longest Substring Without Repeating Characters

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 let

2015-04-30 22:42:28 451

原创 LeetCode 2 Add Two Numbers

LeetCode2 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 numbe

2015-04-30 22:37:30 312

原创 LeetCode 1 TwoSum

LeetCode1.TwoSumGiven 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

2015-04-30 15:18:15 252

原创 《CTCI》3.7 “猫狗”队列

《CITI》P1453 栈与队列题目:3.7 An animal shelter holds only dogs and cats, and operates on a strictly “first in, first out” basis. People must adopt either the “oldest” (based on arrival time) of all animals a

2015-04-28 11:22:22 363

原创 《CTCI》3.6 用两个栈实现排序栈

《CITI》P1433 栈与队列题目:3.6 Write a program to sort a stack in ascending order (with biggest items on top). You may use at most one additional stack to hold items, but you may not copy the elements into any

2015-04-28 11:21:26 402

原创 《CTCI》3.3 栈之栈

《CITI》P1373 栈与队列题目:3.3 Imagine a (literal) stack of plates. If the stack gets too high, it might topple. Therefore, in real life, we would likely start a new stack when the previous stack exceeds some

2015-04-28 11:14:19 441

原创 《CTCI》2.7 检查链表是否为回文

《CITI》P12 链表题目:2.7 Implement a function to check if a linked list is a palindrome

2015-04-25 11:17:45 289

原创 《CTCI》2.6 寻找有环链表的开头结点

《CITI》P1262 链表题目:2.6 Given a circular linked list, implement an algorithm which returns the node at the beginning of the loop.

2015-04-25 11:17:05 297

原创 《CTCI》2.5 链表表示的整数求和

《CITI》P1232 链表题目:2.5 You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the 1 ‘s digit is at the head of the l

2015-04-25 11:09:56 368

原创 《CTCI》2.4 划分链表

《CITI》P1212 链表题目:2.4 Write code to partition a linked list around a value x, such that all nodes less than x come before alt nodes greater than or equal to x.

2015-04-25 11:07:58 300

原创 《CTCI》2.3 删除链表某结点

《CITI》P12 链表题目:2.3 Implement an algorithm to delete a node in the middle of a singly linked list, given only access to that node.

2015-04-25 11:06:21 258

原创 《CTCI》2.2 单项链表中倒数第k个结点

《CITI》P1182 链表题目:2.2 Implement an algorithm to find the kth to last element of a singly linked list.

2015-04-25 11:04:39 315

原创 《CTCI》2.1 移除未排序链表中的重复结点

《CITI》P1172 链表题目:2.1 Write code to remove duplicates from an unsorted linked list. FOLLOW UP How would you solve this problem if a temporary buffer is not allowed?

2015-04-25 11:01:34 467

原创 《CTCI》1.8 调用一次isSubstring判断旋转字符串

《CITI》P1161 数组与字符串题目:1.8 Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, si and s2, write code to check Ifs2 is a rotation of si using only o

2015-04-24 22:23:49 548

原创 《CTCI》1.7 二维数组的含0元素所在行列清零

《CITI》P1151 数组与字符串题目:1.7 Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to 0.

2015-04-24 22:20:20 852

原创 《CTCI》1.6 旋转二维数组

《CITI》P1141 数组与字符串题目:1.6 Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees. Can you do this in place?

2015-04-24 22:18:42 217

原创 《CTCI》1.5 字符串“压缩”

《CITI》P1121 数组与字符串题目:1.5 Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2blc5a3. If the “compressed” s

2015-04-24 22:16:39 432

原创 《CTCI》1.4 替换字符串中的空格为“%20”

《CITI》P1111 数组与字符串题目:1.4 Write a method to replace all spaces in a string with ‘%20’. You may assume that the string has sufficient space at the end of the string to hold the additional characters, and

2015-04-24 22:14:08 313

原创 《CTCI》1.3 变位词

《CITI》P1091 数组与字符串题目:1.3 Given two strings, write a method to decide if one is a permutation of the other.链接anagram (变位词)

2015-04-24 22:11:16 261

原创 《CTCI》1.2 反转null结尾的字符串

《CITI》P1091 数组与字符串题目:1.2 Implement a function void reverse (char* str) in Cor C++ which reverses a null-terminated string.

2015-04-24 21:23:30 351

原创 《CTCI》3.2 包含min方法的栈

《CITI》P1353 栈与队列题目:3.2 How would you design a stack which, in addition to push and pop, also has a function min which returns the minimum element? Push, pop and min should all operate in 0(1) time

2015-04-24 19:50:19 245

原创 《CTCI》1.1 字符串的所有字符是否全部相同

《CITI》1.1 P1081.1 Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?

2015-04-24 19:42:17 321

原创 《CTCI》3.1 一个数组实现多个栈

《CITI》P1083 栈与队列题目:3.1 Describe how you could use a single array to implement three stacks.解答://3.1 Describe how you could use a single array to implement three stacks.#include <iostream>#include <win

2015-04-24 17:22:57 313

原创 《剑指Offer》面试题25:二叉树中和为某一值的路径

《剑指Offer》 P143面试题25:二叉树中和为某一值的路径题目:

2015-04-24 10:27:09 616

原创 《剑指Offer》面试题24:二叉搜索树的后序遍历序列

《剑指Offer》 P140面试题24:二叉搜索树的后序遍历序列题目:

2015-04-24 10:24:19 374

原创 《剑指Offer》面试题23:从上到下打印二叉树

《剑指Offer》 P137面试题23:从上到下打印二叉树题目:

2015-04-24 10:22:32 303

原创 《剑指Offer》面试题22:栈的压入,弹出序列

《剑指Offer》 P134面试题22:栈的压入,弹出序列题目:

2015-04-24 10:19:10 532

原创 《剑指Offer》面试题21:包含min函数的栈

《剑指Offer》 P132面试题21:包含min函数的栈题目:

2015-04-24 10:16:43 637

空空如也

空空如也

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

TA关注的人

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