Posts tagged

Time Complexity

The Data Structures Cheatsheet: Time & Space Complexity for Every Structure You Need

A single-page reference covering the ten data structures that dominate coding interviews: arrays, linked lists, stacks, queues, hash maps, sets, trees, heaps, graphs, and tries. Each structure gets a complexity table with average and worst-case costs for access, search, insertion, and deletion, plus space complexity, a minimal Python snippet showing idiomatic usage, and guidance on when to reach for it. Includes a master comparison table for quick scanning before an interview and links to the full lessons in the 60-day challenge for deeper study.

Introduction to Merge Sort and Time Complexity

Explains merge sort as a divide-and-conquer algorithm: recursively split an array into halves, sort each half, and merge the results in order. Includes a complete Python implementation with step-by-step commentary. Introduces Big-O notation to reason about algorithmic efficiency and explains why merge sort achieves O(n log n) in all cases by combining log n levels of recursion with O(n) merging work per level. Compares merge sort against bubble, selection, insertion, and quick sort across best, average, and worst-case scenarios.