Document 7177863

Download Report

Transcript Document 7177863

ITEC 2620M
Introduction to Data Structures
Instructor: Prof. Z. Yang
Course Website:
http://people.math.yorku.ca/~zyang/it
ec2620m.htm
Office: Tel 3049
Course Objective
• Course is about concepts
– what you can program, not how
• Traditionally, second course in computer science
– still separates top third of programmers
– not taught in any known college diploma program
• Learn and use efficient programming patterns
– “an efficient programmer can often produce programs
that run five times faster than an inefficient
programmer”
2
Textbooks
•“A Practical Introduction to Data Structures
and Algorithm Analysis – Java Edition” by
Clifford A. Shaffer
•Lecture notes and announcements will be
made available at:
http://people.math.yorku.ca/~zyang/it
ec2620m.htm
3
Marking Scheme
• Assignment 1: 10%
• Midterm: 30%
– about 1/3 code, 2/3 concepts
• Final: 60%
– about 1/3 code, 2/3 concepts
• Late Policy
– The assignment is optional. Late assignments will NOT be
accepted. If you miss it, the weight will be added to the weight
of the TWO PROGRAMMING QUESTIONS in the final exam. No
medical note is required. A make-up midterm will NOT be
provided. If you miss the midterm, the weight will be added to
the weight of the final exam.
4
Schedule
Lecture
1a
1b
2a
2b
3a
3b
4a
4b
Topic
Introduction
Searching
Sorting – non-recursive algorithms
Estimation and Complexity analysis –
non-recursive algorithms
More complexity analysis, Complexity
estimation – non-recursive algorithms
Linked lists
Doubly linked lists and Binary trees
Recursion and Binary tree operations
5
Schedule (Cont’d)
Lecture
5a
5b
6a
6b
7a
7b
8a
8b
Topic
Sorting – recursive algorithms
Link list and BST operations
Complexity estimation – recursive
algorithms
Midterm review
MIDTERM
Estimation of recursive algorithm,
abstract data types and Stacks
Stack based recursion, Queues,
Priority Queues
Midterm solution discussion
6
Schedule (Cont’d)
Lecture
Topic
9a
Heaps and Heapsort
9b
Graphs and Graph algorithm
10a
Hashing
10b 2-3 trees
11a B-trees
11b B+trees
12a Review
12b Review
7
Course Organization
• Key concepts first
– searching, sorting, complexity analysis,
linked structures
• Concrete to concept
– searching  sorting  complexity
analysis
– binary tree  recursion
8
Chapter 1
Introduction
Need for Data Structure
• Computer
– Store and retrieve information
– Perform calculation
• Costs and benefits
– A data structure requires a certain amount
of space for each data item it stores, a
certain amount of time to perform a single
basic operation, and a certain amount of
programming effort.
10
Problem, Algorithms and
Programs
• Problem: a task to be performed
• Algorithm: a method or a process
followed to solve a problem
• Program: an instance, or concrete
representation, of an algorithm in some
programming language.
11
Algorithm Efficiency
• Design goals:
– Design an algorithm that is easy to
understand, code, and debug.
– Design an algorithm that makes efficient
use of the computer’s resources.
• Algorithm analysis
12
Three keys to programming
• Algorithm Design
– Sequence, branching, looping – flowcharts and
pseudocode
– Efficiency and time-space tradeoffs (linkages
between algorithms and data structures)
• Data Organization
– objects and classes
– data structures
• Modularization
– methods (modularization of algorithms)
– classes and inheritance (modularization of
data/objects)
13