Data structure
The way data is organized and stored in memory, along with what you can do with it: search, add, delete.
Example
The same 1,000 contacts, stored in a sorted list, are searched in about 10 steps; in any order, in up to 1,000.
Test yourself: Data structure
What is an algorithm
What is a data structure?
The list of 1,000 contacts is the same, but stored as a sorted list it's searched in about 10 steps, and unsorted in up to 1,000. The search steps are the algorithm.
What is an algorithm
Data structures give the algorithm its foundation, and the algorithm ___ them to solve a problem.
A sorted list of 1,000 names on its own just stores data. With binary search on top, it finds a name in about 10 steps.
Types of structures
What are all data structures built with?
A hash table with 1,000 buckets can be an array of 1,000 slots where each slot has a linked list with the elements that land there.
0/3
â–¶ Play