- Chapter 2 Getting Started
- Chapter 4 Divide-and-Conquer
- Chapter 5 Probabilistic Analysis and Randomized Algorithms
- Chapter 6 Heapsort
- Chapter 7 Quicksort
- Chapter 8 Sorting in Linear Time
- Chapter 10 Data Structures
- Chapter 12 Binary Search Trees
- Chapter 13 Red-Black Trees
- Chapter 14 Augmenting Data Structures
- Chapter 15 Dynamic Programming
- Chapter 16 Greedy Algorithms
- Chapter 17 Amortized Analysis
- Others
Introduction to Algorithms, 3rd edition
If you have any questions or intend to improve my solution,
you could directly post an issue or fork a repository by yourself
Thanks for your contribution.
Continuous Updating
wuzhiyi
C - Chapter
E - Exercise
P - Problem
C_2.3.1: Chapter 2.3.1
E_2.3-5.2: Exercise 2.3-5, 2nd version
E_10.1-5~7: Exercise 10.1-5 ~ 10.1-7
- Chapter 2.3.1 - MERGE SORT
- Exercise 2.1-4 - ADD BINARY
- Exercise 2.2-2 - SELECTION SORT|
- Exercise 2.3-2 - MERGE SORT (no sentinel)
- Exericse 2.3-5 - BINARY SEARCH
- Exercise 2.3-6 - use BINARY SEARCH improve INSERTION SORT
- Exercise 2.3-7 - find sum
- Problem 2-1 - INSERTION SORT on small arrays in MERGE SORT
- Problem 2-2 - correctness of BUBBLESORT
- Problem 2-4- inversions
- Chapter 4.1 - the maximum-subarray problem
- Exercise 4.1-3 - crossover point of brute-force & recursive algorithm for the maximum-subarray problem
- Exercise 4.1-4 - the maximum-subarray problem (allow empty subarray)
- Exercise 4.1-5 - the maximum-subarray problem (nonrecursive & linear-time)
- Exercise 4.2-2 - Strassen's algorithm
- Problem 4-6 - Monge arrays
- Exercise 5.1-2 - RANDOM(a,b) makes calls to RANDOM(0,1)
- Exercise 5.1-3 - BIASED-RANDOM
- Chapter 6 - heap sort
- Exercise 6.2-5 - MAX-HEAPIFY (iterative)
- Exercise 6.5-3 - min-heap
- Exercise 6.5-6 - HEAP-INCREASE-KEY (INSERTION-SORT)
- Exercise 6.5-9 - min-heap for k-way merging
- Problem 6-2 - analysis of d-ary heaps
- Problem 6-3 - Young tableaus
- Chapter 7.3 - RANDOMIZED-QUICKSORT
- Exercise 7.4-5 - improve QUICKSORT by INSERTION SORT
- Problem 7-1 - Hoare partition correctness
- Problem 8-2 - sorting in place in linear time
- Problem 8-3 - sorting variable-length items
- Problem 8-5 - averaging sorting
- Problem 8-7 - the 0-1 sorting lemma and columnsort
- Exercise 10.1-5 - deque (double-ended queue)
- Exercise 10.2-2 - implement a stack using a singly linked list
- Exercise 10.2-3 - implement a queue by a singly linked list
- Exercise 10.2-5 - implement the dictionary operations using singly linked, circular lists
- Exercise 10.2-7 - nonrecursively reverse a singly linked list
- Exercise 10.3-2 - implement ALLOCATE-OBJECT & FREE-OBJECT by singly-array
- Exercise 10.3-5 - COMPACTIFY-LIST (doubly linked list)
- Exercise 10.4-2 - recursively print out the key of each node in a binary tree
- Exercise 10.4-3 - nonrecursively print out the key of each node in a binary tree
- Problem 10-2 - mergeable heaps using linked lists
- Problem 12-1 - binary search trees with equal keys
- Problem 12-2 - radix trees
- Problem 13-1 - persistent dynamic sets
- Problem 13-4 - Treaps
- Chapter 14.3 - interval trees
- Exercise 14.3-6 - maintain a dynamic set that supports the operation MIN-GAP
- Exercise 15.1-5 - the Fibonacci numbers (dynamic-programming algorithm)
- Exercise 16.1-2 - the last activity to start (greedy algorithm)
- Exercise 16.1-4 - interval-graph coloring problem
- Chapter 17.1 - incrementing a binary counter
- Additive-Cipher - additive cipher (BRUTE-FORCE)
- Ext-Euclid - extended Euclidean algorithm
- Modular-Exp - modular exponentiation algorithm
- Multiplicative-Inverse - multiplicative inverse (Fermat's little theorem & extended Euclidean algorithm)
The MIT License (MIT)
Copyright (c) 2015 vinci
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
connect to my repository data-structure