A structured, interview-focused Data Structures & Algorithms roadmap in Dart, progressing from programming fundamentals to advanced problem solving.
This repository is a Dart-first DSA practice roadmap designed to build strong programming fundamentals and progressively prepare for coding interviews.
Dart Fundamentals
β
Problem Solving
β
Patterns
β
Strings
β
Lists / Arrays
β
Set / Map / Hashing
β
Recursion
β
Searching & Sorting
β
Stack / Queue
β
Linked List
β
Trees / BST
β
Heap
β
Graphs
β
Greedy
β
Dynamic Programming
- Learn DSA using Dart
- Build strong programming fundamentals
- Solve coding problems independently
- Understand time and space complexity
- Learn common DSA patterns
- Prepare for technical coding interviews
- Write clean and optimized Dart code
dart-dsa/
β
βββ 01_dart_fundamentals/
βββ 02_input_output/
βββ 03_conditions/
βββ 04_loops/
βββ 05_functions/
βββ 06_strings/
βββ 07_patterns/
βββ 08_lists_arrays/
βββ 09_sets_maps_hashing/
βββ 10_recursion/
βββ 11_backtracking/
βββ 12_searching/
βββ 13_sorting/
βββ 14_two_pointers/
βββ 15_sliding_window/
βββ 16_prefix_sum/
βββ 17_stack/
βββ 18_queue/
βββ 19_linked_list/
βββ 20_trees/
βββ 21_bst/
βββ 22_heap/
βββ 23_graphs/
βββ 24_greedy/
βββ 25_dynamic_programming/
β
βββ README.md
main()- Comments
- Variables
- Data Types
vardynamicfinalconstlate- Operators
- Type Conversion
- Null Safety
- Hello World
- Add Two Numbers
- Swap Two Numbers
- Arithmetic Operations
- Temperature Conversion
- Area of Circle
- Area of Square
- Area of Rectangle
- Simple Interest
- Compound Interest
- ASCII / Character Value
import 'dart:io';
void main() {
int n = int.parse(stdin.readLineSync()!);
print(n);
}| API | Purpose |
|---|---|
stdin.readLineSync() |
Read input |
int.parse() |
String β int |
double.parse() |
String β double |
int.tryParse() |
Safe parsing |
print() |
Print with newline |
stdout.write() |
Print without newline |
stdout.writeln() |
Print with newline |
- Read Integer
- Read String
- Read Multiple Values
- Parse Integer
- Parse Double
- Console Calculator
- Formatted Output
ifelseelse if- Nested
if - Ternary Operator
switch- Logical Operators
- Even or Odd
- Positive / Negative / Zero
- Largest of Two
- Largest of Three
- Leap Year
- Vowel or Consonant
- Alphabet / Digit / Special Character
- Uppercase / Lowercase
- Voting Eligibility
- Days in Month
- Calculator Using Switch
forwhiledo-while- Nested Loops
breakcontinue
- Print
1toN - Print
Nto1 - Multiplication Table
- Sum of Natural Numbers
- Sum of Even Numbers
- Sum of Odd Numbers
- Sum of Digits
- Product of Digits
- Reverse Number
- First and Last Digit
- Factorial
- Power of Number
- Prime Number
- Armstrong Number
- Palindrome Number
- Fibonacci Series
- GCD / HCF
- LCM
- Functions
- Parameters
- Return Values
- Optional Parameters
- Named Parameters
required- Arrow Functions
- Anonymous Functions
- Higher-Order Functions
- Prime Checker Function
- Factorial Function
- Fibonacci Function
- GCD Function
- LCM Function
- Armstrong Checker
- Palindrome Checker
- Number Conversion
String text = "Dart";
text.length;
text.toUpperCase();
text.toLowerCase();
text.contains("ar");
text.substring(0, 2);
text.split("");- Reverse String
- String Palindrome
- Count Vowels
- Count Consonants
- Count Digits
- Count Special Characters
- Character Frequency
- Remove Duplicate Characters
- First Non-Repeating Character
- First Repeating Character
- Anagram
- Count Words
- Reverse Words
- Longest Word
- Square Pattern
- Rectangle Pattern
- Right Triangle
- Inverted Triangle
- Number Triangle
- Character Triangle
- Pyramid
- Inverted Pyramid
- Diamond
- Hollow Square
- Hollow Triangle
- Floyd's Triangle
- Pascal's Triangle
- Butterfly Pattern
- Numeric Palindrome Pattern
- Alphabet Pattern
*
* *
* * *
* * * *
* * * * *
Dart uses List as the primary array-like data structure.
List<int> numbers = [10, 20, 30, 40];- Print Array
- Sum Elements
- Maximum Element
- Minimum Element
- Count Even Elements
- Count Odd Elements
- Count Negative Elements
- Reverse Array
- Find Duplicates
- Remove Duplicates
- Frequency of Elements
- Second Largest
- Second Smallest
- Left Rotation
- Right Rotation
- Merge Sorted Arrays
- Move Zeros
- Missing Number
- Duplicate Number
- Intersection
- Union
Set<int> values = {1, 2, 3};Map<int, int> frequency = {};
for (int value in numbers) {
frequency[value] = (frequency[value] ?? 0) + 1;
}- Remove Duplicates
- Frequency Counting
- Two Sum
- First Unique Element
- First Repeating Element
- Intersection
- Union
- Group Anagrams
- Character Frequency
- Duplicate Detection
- Base Case
- Recursive Case
- Call Stack
- Recursion Tree
- Complexity Analysis
- Factorial
- Fibonacci
- Sum of Numbers
- Power
- Reverse String
- Reverse Number
- Palindrome
- Array Traversal
- Maximum / Minimum
- GCD
- Binary Search
- Generate Subsets
- Generate Permutations
- Combination Sum
- N-Queens
- Rat in a Maze
- Sudoku Solver
- Generate Parentheses
- Linear Search
- Binary Search
- First Occurrence
- Last Occurrence
- Lower Bound
- Upper Bound
- Search Insert Position
- Search Rotated Sorted Array
- Find Peak Element
- Square Root Using Binary Search
| Algorithm | Average | Worst |
|---|---|---|
| Bubble Sort | O(nΒ²) | O(nΒ²) |
| Selection Sort | O(nΒ²) | O(nΒ²) |
| Insertion Sort | O(nΒ²) | O(nΒ²) |
| Merge Sort | O(n log n) | O(n log n) |
| Quick Sort | O(n log n) | O(nΒ²) |
| Heap Sort | O(n log n) | O(n log n) |
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Sort 0s and 1s
- Sort 0s, 1s and 2s
- Kth Smallest
- Kth Largest
- Pair With Target Sum
- Two Sum on Sorted Array
- Remove Duplicates
- Move Zeros
- Reverse Array
- Container With Most Water
- 3Sum
- 4Sum
- Maximum Sum Subarray of Size K
- First Negative Number in Every Window
- Longest Substring Without Repeating Characters
- Longest Substring With K Distinct Characters
- Minimum Window Substring
- Maximum Consecutive Ones
- Running Sum
- Range Sum
- Subarray Sum
- Subarray Sum Equals K
- Equilibrium Index
- Maximum Subarray
Dart can use List as a stack:
List<int> stack = [];
stack.add(10);
stack.add(20);
int value = stack.removeLast();- Implement Stack
- Valid Parentheses
- Reverse String
- Min Stack
- Next Greater Element
- Next Smaller Element
- Previous Greater Element
- Previous Smaller Element
- Largest Rectangle in Histogram
- Evaluate Postfix Expression
import 'dart:collection';
Queue<int> queue = Queue();
queue.add(10);
queue.add(20);
int value = queue.removeFirst();- Implement Queue
- Circular Queue
- Stack Using Queues
- Queue Using Stacks
- First Non-Repeating Character
- Sliding Window Maximum
- Node
- Head
- Tail
- Traversal
- Insert
- Delete
- Search
- Reverse
- Create Linked List
- Insert at Beginning
- Insert at End
- Insert at Position
- Delete Node
- Search Node
- Reverse Linked List
- Find Middle Node
- Detect Cycle
- Remove Cycle
- Merge Sorted Lists
- Remove Duplicates
- Intersection of Linked Lists
- Binary Tree
- Root
- Parent
- Child
- Leaf
- Height
- Depth
- Level
- Preorder
- Inorder
- Postorder
- Level Order
- Tree Traversal
- Maximum Depth
- Minimum Depth
- Count Nodes
- Count Leaves
- Diameter
- Mirror Tree
- Symmetric Tree
- Lowest Common Ancestor
- Insert
- Search
- Delete
- Minimum
- Maximum
- Validate BST
- Kth Smallest
- Lowest Common Ancestor
- Sorted Array to BST
- Min Heap
- Max Heap
- Heapify
- Insert
- Delete
- Priority Queue
- Kth Largest
- Kth Smallest
- Top K Frequent Elements
- Merge K Sorted Arrays
- Merge K Sorted Linked Lists
- Running Median
- Adjacency Matrix
- Adjacency List
- BFS
- DFS
- Connected Components
- Cycle Detection
- Topological Sort
- Dijkstra
- Bellman-Ford
- Kruskal
- Prim
- Number of Islands
- Clone Graph
- Course Schedule
- Flood Fill
- Detect Cycle
- Shortest Path
- Connected Components
- Activity Selection
- Fractional Knapsack
- Job Sequencing
- Minimum Coins
- Jump Game
- Gas Station
- Interval Scheduling
- Merge Intervals
- Memoization
- Tabulation
- DP State
- State Transition
- Base Cases
- Fibonacci
- Climbing Stairs
- House Robber
- 0/1 Knapsack
- Unbounded Knapsack
- Coin Change
- Longest Common Subsequence
- Longest Increasing Subsequence
- Edit Distance
- Partition Problems
- Grid DP
| Complexity | Name |
|---|---|
O(1) |
Constant |
O(log n) |
Logarithmic |
O(n) |
Linear |
O(n log n) |
Linearithmic |
O(nΒ²) |
Quadratic |
O(2βΏ) |
Exponential |
O(n!) |
Factorial |
Always explain both time complexity and space complexity during an interview.
For every problem:
Understand
β
Identify Input / Output
β
Check Edge Cases
β
Brute Force
β
Optimize
β
Implement
β
Test
β
Time Complexity
β
Space Complexity
β
Explain
- Fundamentals
- Conditions
- Loops
- Basic Strings
- Basic Lists
- Basic Math
- Hashing
- Recursion
- Sorting
- Binary Search
- Two Pointers
- Sliding Window
- Stack
- Queue
- Backtracking
- Trees
- Graphs
- Heap
- Greedy
- Dynamic Programming
- Syntax
- Variables
- Data Types
-
var -
dynamic -
final -
const -
late - Null Safety
- Operators
- Input / Output
- Conditions
- Loops
- Functions
- Strings
- Patterns
- Lists
- Sets
- Maps / Hashing
- Recursion
- Backtracking
- Searching
- Sorting
- Two Pointers
- Sliding Window
- Prefix Sum
- Stack
- Queue
- Linked List
- Tree
- BST
- Heap
- Graph
- BFS
- DFS
- Binary Search
- Greedy
- Dynamic Programming
- Complexity Analysis
- Edge Cases
- Brute Force β Optimized
- Dry Run
- Code Explanation
- Clean Dart Implementation
import 'dart:io';
void main() {
int n = int.parse(stdin.readLineSync()!);
// Solution
}import 'dart:collection';
void main() {
Queue<int> queue = Queue();
// Solution
}import 'dart:math';
void main() {
// Solution
}Don't measure your progress only by the number of problems solved.
For every problem, ask yourself:
Can I solve it?
β
Can I explain it?
β
Can I implement it in Dart?
β
Can I analyze complexity?
β
Can I optimize it?
β
Can I solve a variation?
Learn Dart
β
Build Fundamentals
β
Master DSA Patterns
β
Solve Problems
β
Analyze Complexity
β
Optimize Solutions
β
Practice Interviews
β
Crack Coding Rounds π
If this repository helps you with Dart, DSA, or interview preparation, consider giving it a β.
Dart + DSA + Consistent Practice = Strong Coding Skills π