- Implement, evaluate, and use some common data structures
- Identify and diagram common data structures
- Determine the correct data structure for interview-style problems
- Articulate the importance of Data Structures and their associated efficiency
- Define Abstract Data Type
- The most fundamental concept in Computer Science
- The building blocks of the computing world
- Knowledge of data structures and their performance is required to build efficient software systems
Data is everywhere
The way we store, organize and group data matters
Different structures are needed to organize different kinds of data
- text
- images
- videos
- relational
- geospatial
- etc.
How we store, organize and group data matters
If we do not use the right kind of logical structures to store our data, our software systems will not be efficient
A way to store and organize data in a computer, so that it can be used efficiently.
Efficiency of the data structure and it's operations will depend on the structure used.
Computer memory and speed are finite resources.
- In lower level languages like C and C++ you must manually allocate and deallocate memory as you use it.
- JavaScript and Java both use automatic memory management called "Garbage Collection"
- Mathematical and Logical Models
- Abstract Data Type (ADT)
- Implementation
- Turned on/off
- Receive signals
- Audio/Video
define data items and operations, but no implementation
- Class in C++, C#, Java, Python etc.
- defining something in terms of data and operations, allows for information hiding
- Store a given number of elements of a given type
- Read elements by position
- Modify element at a position
What data structure do you know of that has these features?
- empty list has size 0
- insert
- remove
- count
- read elements by position
- modify elements by position
What data do you store?
- Seats
- Seats reserved or available
What operations do you provide?
- Determine available seats
- Reserve a seat
- Cancel a reservation
- Find a block of available seats
- Declare n
char
variables for n seats
- All variables initially marked with 'A' (Available)
- Reserved seats will be marked with an 'R' (Reserved)
How do we go about listing available seats?
Troublesome with lots of variables
- s1: 'A'
- s2: 'R'
- s3: 'A'
- .
- .
- sN: 'A'
Create a char
array of size n for n seats
- All elements initially marked with 'A' (Available)
- Reserved seats will be marked with 'R' (Reserved)
How do we go about listing available seats?
||||| ---|---|---|---|--- 'A'|'R'|'A'|...|'A' 0|1|2||n-1
- Sorting
- Searching
- Inserting
- Removing
- Modifying
- Traversing
- Arrays
- Linked List
- Stacks
- Queues
- Graphs
- Trees
- Hash Map
- Logical View
- Operations (members)
- Cost of Operations (efficiency)
- Implementation
A way to store and organize data in a computer, so that it can be used efficiently.
Efficiency of the data structure and it's operations will depend on the structure used.
- Articulate the importance of Data Structures and their associated efficiency
- Define Abstract Data Type