原创 《CTCI》1.3 變位詞

《CITI》P109 1 數組與字符串 題目: 1.3 Given two strings, write a method to decide if one is a permutation of the other. 鏈接 an

原创 《CTCI》2.7 檢查鏈表是否爲迴文

《CITI》P128 2 鏈表 題目: 2.7 Implement a function to check if a linked list is a palindrome

原创 FaceWarehouse: a 3D Facial Expression Database for Visual Computing

FaceWarehouse: a 3D Facial Expression Database for Visual Computing IV.應用 FaceWarehouse能被應用在多種視覺計算應用中。在這部分,我們展示4個實例應用:f

原创 《劍指Offer》 面試題27:二叉搜索樹與雙向鏈表

《劍指Offer》 P151 面試題27:二叉搜索樹與雙向鏈表 題目 輸入一棵二叉搜索樹,將該二叉搜索樹轉換成一個排序的雙向鏈表。要求不能創建任何新的結點,只能調整樹中結點指針的指向。 解答 class Solution { public

原创 《CTCI》3.4 漢諾塔遊戲

《CTCI》 P140 3 棧與隊列 題目 3.4 In the classic problem of the Towers of Hanoi, you have 3 towers and N disks of different siz

原创 LeetCode 80 Remove Duplicates from Sorted Array II

LeetCode 80 Remove Duplicates from Sorted Array II 題目 Follow up for “Remove Duplicates”: What if duplicates are allowe

原创 LeetCode 2 Add Two Numbers

LeetCode 2 Add Two Numbers 題目 You are given two linked lists representing two non-negative numbers. The digits are stor

原创 路徑搜索之A*算法

翻譯自:http://theory.stanford.edu/~amitp/GameProgramming/ 我們想要解決的問題是在遊戲中從一個起點到達終點來獲取一個遊戲的目標。路徑搜索就是處理這樣從起點到終點尋找一條好路徑的問題——避

原创 《劍指Offer》面試題33:把數組排成最小的數

//面試題33:把數組排成最小的數 #include <iostream> #include <vector> #include <string> #include <sstream> #include <Windows.h> usi

原创 《CTCI》3.6 用兩個棧實現排序棧

《CITI》P143 3 棧與隊列 題目: 3.6 Write a program to sort a stack in ascending order (with biggest items on top). You may use a

原创 《CTCI》3.7 “貓狗”隊列

《CITI》P145 3 棧與隊列 題目: 3.7 An animal shelter holds only dogs and cats, and operates on a strictly “first in, first out”

原创 《CTCI》3.5 用兩個棧實現隊列

《CTCI》 P142 3 棧與隊列 題目 3.5 實現一個MyQueue類,該類用兩個棧來實現一個隊列。 解答 #include <stack> template <typename T> class queue { public:

原创 LeetCode 3 Longest Substring Without Repeating Characters

LeetCode 3 Longest Substring Without Repeating Characters 題目 Given a string, find the length of the longest substring w

原创 《CTCI》3.3 棧之棧

《CITI》P137 3 棧與隊列 題目: 3.3 Imagine a (literal) stack of plates. If the stack gets too high, it might topple. Therefore,

原创 LeetCode 36 Valid Sudoku

LeetCode 36 Valid Sudoku 題目 Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board