Cracking Programming Interviews: 500 Questions with Solutions (Paperback)

Sergei Nakariakov

  • 出版商: CreateSpace Independ
  • 出版日期: 2014-02-07
  • 售價: $1,310
  • 貴賓價: 9.5$1,245
  • 語言: 英文
  • 頁數: 524
  • 裝訂: Paperback
  • ISBN: 1495459802
  • ISBN-13: 9781495459801
  • 相關分類: 職涯發展
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

商品描述

Part I Algorithms and Data Structures

1 Fundamentals

Approximating the square root of a number
Generating Permutation Efficiently
Unique 5-bit Sequences
Select Kth Smallest Element
The Non-Crooks Problem
Is this (almost) sorted?
Sorting an almost sorted list
The Longest Upsequence Problem
Fixed size generic array in C++
Seating Problem
Segment Problems
Exponentiation
Searching two-dimensional sorted array
Hamming Problem
Constant Time Range Query
Linear Time Sorting
Writing a Value as the Sum of Squares
The Celebrity Problem
Transport Problem
Find Length of the rope
Switch Bulb Problem
In, On or Out
The problem of the balanced seg
The problem of the most isolated villages

2 Arrays

The Plateau Problem
Searching in Two Dimensional Sequence
The Welfare Crook Problem
2D Array Rotation
A Queuing Problem in A Post Office
Interpolation Search
Robot Walk
Linear Time Sorting
Write as sum of consecutive positive numbers
Print 2D Array in Spiral Order
The Problem of the Circular Racecourse
Sparse Array Trick
Bulterman’s Reshuffling Problem
Finding the majority
Mode of a Multiset
Circular Array
Find Median of two sorted arrays
Finding the missing integer
Finding the missing number with sorted columns
Re-arranging an array
Switch and Bulb Problem
Compute sum of sub-array
Find a number not sum of subsets of array
Kth Smallest Element in Two Sorted Arrays
Sort a sequence of sub-sequences
Find missing integer
Inplace Reversing
Find the number not occurring twice in an array

3 Trees

Lowest Common Ancestor(LCA) Problem
Spying Campaign


4 Dynamic Programming

Stage Coach Problem
Matrix Multiplication
TSP Problem
A Simple Path Problem
String Edit Distance
Music recognition
Max Sub-Array Problem

5 Graphs

Reliable distribution
Independent Set
Party Problem

6 Miscellaneous

Compute Next Higher Number
Searching in Possibly Empty Two Dimensional Sequence
Matching Nuts and Bolts Optimally
Random-number generation
Weighted Median
Compute a^n
Compute a^n revisited
Compute the product a × b
Compute the quotient and remainder
Compute GCD
Computed Constrained GCD
Alternative Euclid’ Algorithm
Revisit Constrained GCD
Compute Square using only addition and subtraction
Factorization
Factorization Revisited
Decimal Representation
Reverse Decimal Representation
Solve Inequality
Solve Inequality Revisited
Print Decimal Representation
Decimal Period Length
Sequence Periodicity Problem
Compute Function
Emulate Division and Modulus Operations
Sorting Array of Strings : Linear Time
LRU data structure
Exchange Prefix and Suffix

7 Parallel Algorithms

Parallel Addition
Find Maximum
Parallel Prefix Problem
Finding Ranks in Linked Lists
Finding the k th Smallest Element

8 Low Level Algorithms

Manipulating Rightmost Bits
Counting 1-Bits
Counting the 1-bits in an Array
Computing Parity of a word
Counting Leading/Trailing 0’s
Bit Reversal
Bit Shuffling
Integer Square Root
Newton’s Method
Integer Exponentiation
LRU Algorithm
Shortest String of 1-Bits
Fibonacci words
Computation of Power of 2
Round to a known power of 2
Round to Next Power of 2
Efficient Multiplication by Constants
Bit-wise Rotation
Gray Code Conversion
Average of Integers without Overflow
Least/Most Significant 1 Bit
Next bit Permutation
Modulus Division

Part II C++

8 General
9 Constant Expression
10 Type Specifier
11 Namespaces
12 Misc
13 Classes
14 Templates
15 Standard Library

商品描述(中文翻譯)

第一部分 算法和數據結構

1 基礎知識
- 逼近一個數的平方根
- 高效生成排列
- 唯一的5位序列
- 選擇第K小的元素
- 非騙子問題
- 是否(幾乎)有序?
- 排序幾乎有序的列表
- 最長上升子序列問題
- C++中的固定大小通用數組
- 座位問題
- 區間問題
- 指數運算
- 搜索二維有序數組
- 漢明問題
- 常數時間區間查詢
- 線性時間排序
- 將一個值表示為平方和
- 名人問題
- 運輸問題
- 找到繩子的長度
- 開關燈泡問題
- 在內還是外
- 平衡段問題
- 最孤立的村莊問題

2 數組
- 高原問題
- 在二維序列中搜索
- 福利騙子問題
- 二維數組旋轉
- 郵局排隊問題
- 內插搜索
- 機器人行走
- 線性時間排序
- 將數表示為連續正數的和
- 螺旋順序打印二維數組
- 圓形賽道問題
- 稀疏數組技巧
- Bulterman的重排問題
- 找到眾數
- 多重集合的眾數
- 環形數組
- 找到兩個排序數組的中位數
- 找到缺失的整數
- 找到缺失的數字(按列排序)
- 重新排列數組
- 開關和燈泡問題
- 計算子數組的和
- 找到一個數,它不能表示為數組子集的和
- 兩個排序數組中的第K小元素
- 對子序列進行排序
- 找到缺失的整數
- 原地反轉
- 找到在數組中只出現一次的數字

3 樹
- 最低公共祖先(LCA)問題
- 間諜活動
- ...

4 動態規劃
- 馬車問題
- 矩陣乘法
- TSP問題
- 簡單路徑問題
- 字符串編輯距離
- 音樂識別
- 最大子數組問題
- ...

5 圖
- 可靠分發
- 獨立集
- 派對問題
- ...

6 其他
- 計算下一個更大的數字
- 在可能為空的二維序列中搜索
- 最佳匹配螺母和螺栓
- 隨機數生成
- 加權中位數
- 計算a的n次方
- 重新計算a的n次方
- 計算a和b的乘積
- 計算商和餘數
- 計算最大公約數
- 計算受限制的最大公約數
- 替代歐幾里得算法
- 重新訪問受限制的最大公約數
- 只使用加法和減法計算平方
- 因式分解
- 重新訪問因式分解
- 十進制表示
- 反向十進制表示
- 解不等式
- 重新訪問解不等式
- 打印十進制表示
- 十進制循環節長度
- 序列周期性問題
- 計算函數
- 模擬除法和取模運算
- 字符串數組排序:線性時間
- LRU數據結構
- 交換前綴和後綴

7 平行算法
- 平行加法
- 找到最大值
- 平行前綴問題
- 在鏈表中找到排名
- 找到第k小的元素

8 低級算法
- 操作最右邊的位
- 計算1的位數
- 計算數組中的1位數
- 計算一個字的奇偶性
- 計算前導/尾隨0的位數
- 位反轉
- 位洗牌
- 整數平方根
- 牛頓法
- 整數冪
- LRU算法
- 最短的1位字符串
- 斐波那契詞
- 計算2的冪次方