cs algorithms
Lists & Sets: Choosing the Right Tool
A list stores items in order. A set stores unique items for instant lookup. Choosing between them changes your program from O(N²) to O(N). This lesson builds intuition for when to reach for each data structure, how their Big O costs differ, & how to combine them to solve real problems.