Introduction
Imagine trying to organize a messy room full of different items. Without a system, finding what you need takes forever. Data structures solve this problem by organizing data so computers can find and use it quickly and easily.
Think of organizing a kitchen. You can store utensils in a drawer (list), hang pots on a rack (tree-like structure), or keep spices in labeled jars (table). Each way helps you find and use items quickly depending on how you cook.
┌───────────────────────────────┐ │ Data Structure │ ├───────────────┬───────────────┤ │ Types │ Operations │ │ ┌───────────┐ │ ┌───────────┐ │ │ │ List │ │ │ Add │ │ │ │ Tree │ │ │ Remove │ │ │ │ Table │ │ │ Search │ │ │ └───────────┘ │ └───────────┘ │ └───────────────┴───────────────┘
numbers = [10, 20, 30] numbers.append(40) print(numbers) print('First item:', numbers[0])