Data Structure Contents
Data Structure: a collection of values
Algorithms: processes to manipulate these collections of values
What is a Data Structure?
A data structure is like a container for organizing related data. The key is knowing how to organize the data in a suitable structure to meet the required situations.
Two questions about data structure:
How to build a data structure?
How to use this data structure?
Type of Data Structure
-
- Exercise: Reverse A String
Stacks
Queues
Linked List
TreesTries
Graphs
Hash Tables
Data Structures In Different Languages
Each language has its data structures. Even if a language doesn’t have a specific data structure type, other data structure types can be used to build one.
How do computers store data?
RAM(Random Access Memory): Variables are stored here. When the computer is closed, the data is gone.
Storage: Data stored in storage is permanent. Even when the computer is turned off, the data is still there.
CPU: Some super-important data for running the programs is cached in the CPU. The CPU must keep accessing RAM and storage to get the data to run the program, so the closer the CPU is to RAM and storage, the faster the program runs.
Operations on Data Structures
Insertion
Deletion
Traversal
Searching
Sorting
Access