DSA in Dart
What are the main collection types in Dart and when do you use each?
List: ordered, indexed, allows duplicates (O(1) access by index). Set: unordered, unique elements (O(1) loo...
10 XP3m
6 questions
Algorithms, data structures, complexity, problems
List: ordered, indexed, allows duplicates (O(1) access by index). Set: unordered, unique elements (O(1) loo...
List.sort() sorts in-place using a Comparator<T> function. Implement Comparable<T> on a class to make it na...
Binary search on a sorted list runs in O(log n). Dart's collection package provides binarySearch(). Impleme...
Build a Node<T> class with value and next pointer. A LinkedList<T> holds a head reference. O(1) prepend/ins...
Recursion is clean for tree/graph traversal and divide-and-conquer algorithms. Avoid deep recursion in Dart...
List: O(1) access by index/add at end, O(n) insert/remove at front/middle, O(n) contains(). Set/Map (HashMa...