原创 《CTCI》1.6 旋轉二維數組

《CITI》P114 1 數組與字符串 題目: 1.6 Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes,

原创 《CTCI》3.1 一個數組實現多個棧

《CITI》P131 3 棧與隊列 題目: 3.1 Describe how you could use a single array to implement three stacks. 解答: //3.1 Describe h

原创 《劍指Offer》面試題24:二叉搜索樹的後序遍歷序列

《劍指Offer》 P140 面試題24:二叉搜索樹的後序遍歷序列 題目: 點贊 收藏 分享 文章舉報 fxf1012 發佈了57 篇原創文章 · 獲贊 1 · 訪問量

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

《CITI》P111 1 數組與字符串 題目: 1.4 Write a method to replace all spaces in a string with ‘%20’. You may assume that the st

原创 《CTCI》1.5 字符串“壓縮”

《CITI》P112 1 數組與字符串 題目: 1.5 Implement a method to perform basic string compression using the counts of repeated cha

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

《CITI》P108 1 數組與字符串 題目: 1.1 Implement an algorithm to determine if a string has all unique characters. What if you

原创 《CTCI》1.8 調用一次isSubstring判斷旋轉字符串

《CITI》P116 1 數組與字符串 題目: 1.8 Assume you have a method isSubstring which checks if one word is a substring of another

原创 《劍指Offer》面試題21:包含min函數的棧

《劍指Offer》 P132 面試題21:包含min函數的棧 題目: 點贊 收藏 分享 文章舉報 fxf1012 發佈了57 篇原創文章 · 獲贊 1 · 訪問量 2萬

原创 《CTCI》1.2 反轉null結尾的字符串

《CITI》P109 1 數組與字符串 題目: 1.2 Implement a function void reverse (char* str) in C or C++ which reverses a null-termina

原创 《CTCI》2.4 劃分鏈表

《CITI》P121 2 鏈表 題目: 2.4 Write code to partition a linked list around a value x, such that all nodes less than x com

原创 《劍指Offer》面試題23:從上到下打印二叉樹

《劍指Offer》 P137 面試題23:從上到下打印二叉樹 題目: 點贊 收藏 分享 文章舉報 fxf1012 發佈了57 篇原創文章 · 獲贊 1 · 訪問量 2萬

原创 《CTCI》2.1 移除未排序鏈表中的重複結點

《CITI》P117 2 鏈表 題目: 2.1 Write code to remove duplicates from an unsorted linked list. FOLLOW UP How would you sol

原创 《CTCI》2.5 鏈表表示的整數求和

《CITI》P123 2 鏈表 題目: 2.5 You have two numbers represented by a linked list, where each node contains a single digit.

原创 《劍指Offer》面試題25:二叉樹中和爲某一值的路徑

《劍指Offer》 P143 面試題25:二叉樹中和爲某一值的路徑 題目: 點贊 收藏 分享 文章舉報 fxf1012 發佈了57 篇原創文章 · 獲贊 1 · 訪問量

原创 《CTCI》2.2 單項鍊表中倒數第k個結點

《CITI》P118 2 鏈表 題目: 2.2 Implement an algorithm to find the kth to last element of a singly linked list. 點贊