Data Structures - Mount Holyoke College
Download
Report
Transcript Data Structures - Mount Holyoke College
CS211
Data Structures
Sami Rollins
[email protected]
Spring 2005
Introduction
• What is a data structure?
• Why do we need data structures?
• What should you know about data
structures?
Administrative Information
•
•
•
•
Course Website
Syllabus
Academic Dishonesty
Tentative Calendar
http://www.mtholyoke.edu/courses/srollins/cs211/
Assignments
• Reading – Chapter 1
• Homework 0 – due Monday
Data Structures
• What is a data structure?
Data Structures
• What is a data structure?
– “a scheme for organizing related pieces of
information.“ -http://www.webopedia.com/TERM/D/data_structure.html
• Example “pieces of information”…
• Typically describes the operations which can be
performed on the data and/or how data are
organized to support those operations
• An example data structure from CS 101…
Arrays
• Primitive data structure
• What are the operations supported by an
array?
Arrays
• Primitive data structure
• What are the operations supported by an
array?
– Insert data item (location)
– Access data item (location)
• When would you choose to use an array?
• Would you ever need different
functionality?
Common Data Structures
• Stacks – Last In First Out (LIFO)
– Insert on top
– Remove top element
• Queues – First In First Out (FIFO)
– Insert at end
– Remove from beginning
• Trees - Hierarchy
– Root
– Parent
– Children
In this course…
• You will learn
– Data structures and their operations
– Common implementations of data structures
– How to use data structures in a program
C Programming Review
• What is an algorithm?
• What is a variable? How do you declare a
variable?
• What is a function?
• What is an if statement? When would you use
one?
• What is a loop? What are the different types of
loops? When would you use each type?
• What is a pointer?
• What is an array?
• What is a structure?