Exercises from "Beginning algorithms" book
- Defining Algorithms
- Understanding Complexity in Relation to Algorithms
- Understanding Big-O Notation
- Constant Time: O(1)
- Linear Time: O(N)
- Quadratic Time: O(N2)
- Logarithmic Time: O(log N) and O(N log N)
- Factorial Time: O(N!)
- Unit Testing
- What Is Unit Testing?
- Why Unit Testing Is Important
- A JUnit Primer
- Test-Driven Development
- Performing Calculations
- Processing Arrays
- Using Iterators to Overcome Array-based Problems
- Iterator Operations
- The Iterator Interface
- The Iterable Interface
- Iterator Idioms - Standard Iterators
- Recursion
- Recursive Directory Tree Printer Exampl
- Anatomy of a Recursive Algorithm
- The Base Case
- The General Case
- Understanding Lists
- Testing Lists
- Implementing Lists
- An Array List
- A Linked List
- Understanding Queues
- Queue Operations
- The Queue Interface7
- A First-In-First-Out Queue
- Implementing the FIFO Queue
- Blocking Queues
- Example: A Call Center Simulator
- Running the Application
- Stacks
- The Tests
- Implementation
- Example: Implementing Undo/Redo
- Testing Undo/Redo
- The Importance of Sorting
- Sorting Fundamentals
- Understanding Comparators
- Comparator Operations
- The Comparator Interface
- Some Standard Comparators 117
- Working with the Natural Comparator
- Working with the Reverse Comparator
- Understanding Bubble Sort
- The ListSorter Interface
- Testing AbstractListSorter
- Working with a Selection Sort
- Understanding Insertion Sort
- Understanding Stability
- Comparing the Basic Sorting Algorithms
- CallCountingListComparator
- ListSorterCallCountingTest
- Understanding the Algorithm Comparison
- Understanding the Shellsort Algorithm
- Understanding Quicksort
- Understanding the Compound Comparator and Stability
- Understanding the Mergesort Algorithm
- Merging
- The mergesort Algorithm
- Comparing the Advanced Sorting Algorithms
- Understanding Priority Queues
- A Simple Priority Queue Example
- Working with Priority Queues
- Understanding the Unsorted List Priority Queue
- Understanding the Sorted List Priority Queue
- Understanding Heap-ordered Priority Queues
- Sink or Swim
- Comparing the Priority Queue Implementations
- Understanding Binary Searching
- Binary Search Approaches
- A List Searcher
- Recursive Binary Searcher
- Iterative Binary Searcher
- Assessing the List Searcher’s Performance
- Linear Searching for Comparison
- Tests for Performance
- Understanding Binary Insertion
- A List Inserter
- Assessing Performance
- Understanding Binary Search Trees
- Minimum
- Maximum
- Successor
- Predecessor
- Search
- Insertion
- Deletion
- In-order Traversal
- Pre-order Traversal
- Post-order Traversal
- Balancing
- Testing and Implementing a Binary Search Tree
- Assessing Binary Search Tree Performance
- Understanding Hashing
- Working with Hashing
- Linear Probing
- Bucketing
- Assessing Performanc
- Understanding Sets
- Testing Set Implementations
- Contents
- A List Set
- A Hash Set
- A Tree Set 309
- Understanding Maps
- Testing Map Implementations
- A List Map
- A Hash Map
- A Tree Map
- Understanding Ternary Search Trees
- Searching for a Word
- Inserting a Word
- Prefix Searching
- Pattern Matching Putting Ternary Search Trees into Practice Crossword Helper Example
- Understanding B-Trees
- Putting B-Trees into Practice
- A Generic String Searcher Interface
- A Generic Test Suite
- A Brute-Force Algorithm
- The Boyer-Moore Algorithm
- Creating the Tests
- Implementing the Algorithm
- A String Match Iterator
- Comparing the Performance
- Measuring Performance
- How They Compare
- Understanding Soundex
- Understanding Levenshtein Word Distance
- A Quick Geometry Refresher
- Coordinates and Points
- Lines
- Triangles
- Finding the Intersection of Two Lines
- Slope
- Crossing the y Axis
- Finding the Intersection Point
- Finding the Closest Pair of Points
- Where Optimization Fits In
- Understanding Profiling
- The FileSortingHelper Example Program
- Profiling with hprof
- Profiling with JMP
- Understanding Optimization
- Putting Optimization into Practice