My solutions to assignments of Data structures and algorithms (by UCSD and HSE) on Coursera. All problems from course 1 to course 5 have been solved.
Course 1: Algorithmic Toolbox [Certificate]
Algorithmic Warm-up
- Fibonacci Number
- Last Digit of a Large Fibonacci Number
- Greatest Common Divisor
- Least Common Multiple
- Fibonacci Number Again
- Last Digit of the Sum of Fibonacci Numbers
- Last Digit of the Sum of Fibonacci Numbers Again
- Last Digit of the Sum of Squares of Fibonacci Numbers
Greedy Algorithms
- Money Change
- Maximum Value of the Loot
- Car Fueling
- Maximum Advertisement Revenue
- Collecting Signatures
- Maximum Number of Prizes
- Maximum Salary
Divide and Conquer
- Binary Search
- Majority Element
- Improving Quick Sort
- Number of Inversions
- Organizing a Lottery [naive] [faster]
- Closest Points
Dynamic Programming 1
- Money Change Again
- Primitive Calculator
- Edit Distance
- Longest Common Subsequence of Two Sequences
- Longest Common Subsequence of Three Sequences
Dynamic Programming 2
Course 2: Data Structures [Certificate]
Basic Data Structures
- Check brackets in the code
- Compute tree height
- Network packet processing simulation
- Extending stack interface
- Maximum in Sliding Window
Priority Queues and Disjoint Sets
Hash Tables and Hash Functions
- Phone book
- Hashing with chains
- Find pattern in text
- Substring equality
- Longest common substring
- Pattern matching with mismatches
Binary Search Trees
- Binary tree traversals
- Is it a binary search tree? [in-order traversal] [min/max constraint]
- Is it a binary search tree? Hard version
- Set with range sums
- Rope [naive method] [rope structure]
Course 3: Algorithms on Graphs [Certificate]
Undirected Graphs
Directed Graphs
- Checking Consistency of CS Curriculum
- Determining an Order of Courses
- Advanced Problem: Checking Whether Any Intersection in a City is Reachable from Any Other
Most Direct Route
Fastest Route
- Computing the Minimum Cost of a Flight
- Detecting Anomalies in Currency Exchange Rates
- Advanced Problem: Exchanging Money Optimally
Minimum Spanning Trees
Course 4: Algorithms on Strings [Certificate]
Suffix Trees
- Construct a Trie from a Collection of Patterns
- Implement TrieMatching
- Extend TrieMatching
- Construct the Suffix Tree of a String
- Advanced Problem: Find the Shortest Non-Shared Substring of Two Strings
Burrows–Wheeler Transform and Suffix Arrays
- Construct the Burrows–Wheeler Transform of a String
- Reconstruct a String from its Burrows–Wheeler Transform
- Implement BetterBWMatching
- Construct the Suffix Array of a String
Algorithmic Challenges
- Find All Occurrences of a Pattern in a String
- Construct the Suffix Array of a Long String
- Pattern Matching with the Suffix Array
- Advanced Problem: Construct the Suffix Tree from the Suffix Array
Course 5: Advanced Algorithms and Complexity [Certificate]
Flows in Networks
Linear Programming
- Infer Energy Values of Ingredients [1] [2]
- Optimal Diet Problem
- Advanced Problem: Online Advertisement Allocation (Two-Phase Simplex)
NP-completeness
- Assign Frequencies to the Cells of a GSM Network
- Cleaning the Apartment
- Advanced Problem: Advertisement Budget Allocation
Coping with NP-completeness