Vietnam National University, Hanoi
College of Technology
Data Structures and Algorithms
Student Manual
Office Hour:
8am – 5pm weekdays
Contact: Nguyen Viet Ha
Email: hanv@vnu.edu.vn
Phone: 7549016
Hanoi - 2007
Summary
This is the syllabus for Data Structures and Algorithms course intended for undergraduate programs. The following sections provide brief information about Purpose, Description, Objectives, Prerequisites, References Documents and Grades of the course.
Letter to Student
This course and this Student Manual reflect a collective effort by your instructor. This
course is an important component of our academic program. Although it has been offered
for many years, this latest version represents an attempt to expand the range of sources of
information and instruction so that the course continues to be up-to-date and the methods
well suited to what is to be learned.
You will be asked from time-to-time to offer feedback on how the Student Manual is
working and how the course is progressing. Your comments will inform the development
team about what is working and what requires attention. Our goal is to help you learn
what is important about this particular field and to eventually succeed as a professional
applying what you learn in this course.
This Student Manual is designed to assist you through the course by providing specific
information about student responsibilities including requirements, timelines and
evaluations.
I hope you enjoy the course.
Faculty Listing
Contact Information
Faculty Information.
Name:Nguyen Viet HaOffice Location: 309 E3 Building
Email: hanv@vnu.edu.vn
Office Hours: 8am – 5pm weekdays
Support personnel – include all important contact information for:
- Assistants
- Technology Support
- Lab sections/support
- Department staff
Purposes of course
The purpose of this course is to understand important problems, challenges, concepts and techniques from the field of Algorithms and Data Structures. In order to achieve this, students learn how to design efficient algorithms, evaluate their time and space complexity. More specifically, in this course, students will:
- learn good principles of algorithm design;
- learn how to analyse algorithms and estimate their worst-case and average-case behaviour (in easy cases);
- become familiar with fundamental data structures and with the manner in which these data structures can best be implemented;
- become accustomed to the description of algorithms in both functional and procedural styles;
- learn how to apply their theoretical knowledge in practice (via the practical component of the course).
Course Description
This course introduces base knowledge of algorithm design, elementary analysis of algorithms, and fundamental data structures. The emphasis is on choosing appropriate data structures and designing correct and efficient algorithms to operate on these data structures.
In computer programming, algorithms play an important role. You will learn in this course how to develop efficient algorithms, analyse their running time and implement them efficiently. We discuss sorting algorithms, searching, recursion, dynamic and graph algorithms.
The study of algorithms is intrinsically tied to the data structures. Data structures covered in this course are strings, stacks, records, linked lists, hash tables, trees and graphs.
These data structures and algorithms have close relationship. We have arranged them in a reasonable order.
Objectives
At the end of the course, students should
- have a good understanding of how a range of fundamental algorithms work, particularly those concerned with the classical problems of sorting and searching
- be able to analyse the efficiency in terms of space and time of most algorithms
- be able to design new algorithms or modify existing ones for new applications and reason about the efficiency of the result
- be able to organise convenient data structures to solve problems in practice
Prerequisites
The formal prerequisite for this course is Computer Science Fundamentals. In addition, the teaching of Data Structures and Algorithms needs to illustrate by programming languages and vice versa. This course thus should be presented concurrently with the course of programming languages (C, C++, Java).
Readings and Resources
Here are some general books on algorithm and data structures:
Primary Text
- Textbook: T.H. Cormen, C.E. Leiserson, R.L. Rivest, C. Stein, Introduction to Algorithms, Second Edition. MIT Press, 2001, ISBN: 0262032937
- Lecture Notes on Data Structures and Algorithms, accompanied with this syllabus.
Alternatives/Background
- A. Aho, J. Hopcroft, & J. Ullman, The Design and Analysis of Computer Algorithms, Addison Wesley, 1974.
- Baase & Gelder, Computer Algorithms: Introduction to Design and Analysis, 3nd ed., Addison Wesley, 2000.
- Gilles Brassard & Paul Bratley, Algorithmics, Prentice Hall, 1988.
- Donald Knuth, The Art of Computer Programming, Addison Wesley, 2005.
- Robert Kruse, Data Structures and Program Design, Prentice Hall, 1984.
- Udi Manber, Introduction to Algorithms, Addison Wesley, 1989.
- Hồ Sĩ Đàm, Nguyễn Việt Hà, Bùi Thế Duy, Cấu trúc dữ liệu và giải thuật. Nhà xuất bản Giáo dục, 2006.
Grades
The overall grade for this course is based on your performance in (i) exercises, (ii) assignments, (iii) mid-term exam and (iv) final exam, with weights as given below. Exams consist of a midterm and a final exam.
Course component grading weight (it can be changed):
- Exercises: 20%
- Programming assignments: 20%
- Mid-term exam 20%
- Final exam: 40%
Content Information
The content of this course is based on the text book “Introduction to Algorithms” presented in Reading and Resources section. The content has 8 parts, ordering by their dependency in which content of the later part used the knowledge of the previous parts.
The part 1 gives an introduction about algorithms and data structures. It is intended to be a gentle introduction to how we specify algorithms, and many of the fundamental ideas used in algorithm analysis. This part defines what an algorithm is and gives notions of data structures. Later parts will build upon this base.
In part 2, two types of data structures will be presented: Stack and queue. Stacks and queues are dynamic sets in which the element removed from the set by the DELETE operation is prespecified. In a stack, the element deleted from the set is the one most recently inserted: the stack implements a last-in, first-out, or LIFO. Similarly, in a queue, the element deleted is always the one that has been in the set for the longest time, the queue implements a first-in, first out, or FIFO. There are several efficient ways to implement stacks and queues on a computer. In this part we show how to use a simple array to implement each. With the stack and queue data structures, we concentrate on the definition, basic operations, implementation and applications of each in computer science.
In part 3, we present the linked lists, a data structure that students should know before learning the binary search tree. The fundamental types of linked lists are single-linked lists, double-linked lists, circularly-linked lists, linearly-linked lists. We describe these types of linked lists and integrated algorithms used to create, insert, delete, … their nodes.
In part 4, we study the recursion in computer programming. Recursion defines a function in terms of itself, it is largely used to solve problems such as divide and conquer, backtracking,… We give an overview about recursive functions, recursive algorithms, recursive programming and a comparison between recursion and iteration in programming.
Part 5 of this course gives an interesting data structure and its integrated algorithms, the binary search tree. We will focus on principal operations of binary search tree such as searching, insertion, deletion. Compared to linear data structures like linked lists and one dimensional arrays, which have only one logical means of traversal, tree structures can be traversed in many different ways. In this part, we present also three types of traversals: preoder, inorder, postorder.
In part 6, we examine basic sort algorithms. These algorithms are: Insertion sort, Quick sort, Bubble sort, Merge sort, Heap sort, Selection sort. With each algorithm, we describe the mechanism and their implementation. The comparison of the complexity of these algorithms will be introduced.
Part 7 presents problems relating graph. This part includes the graph theory, minimum spanning trees problems. We also give an algorithm to solve the shortest paths problems. Concerning algorithms of search in a graph, we introduce the breath-first search and depth-first search.
Finally, part 8 introduces hash tables, an type of data structure which are used to optimize the capacity of storage and the speed of searching, hash tables support the dictionary operations INSERT, DELETE, and SEARCH. In this part, we will also present how to choose convenient hash functions to distribute elements into hash tables and how to solve the collision problems in hashing.
Instructional Sequence
Unit 1. Introduction
Task 1: Read the following:
- Introduction to Data Structure and Algorithms
- Textbook: The role of algorithms in computing (1.1 – 1.2)
- Textbook: Introduction to data structures. pp. 197
Unit 2. Stack and Queue
Task 1: Read the following:
- Stack and Queue
- Textbook: Stack and Queues pp.200
Task 2: Do the following exercises:
These exercises are NOT homework questions.
They are for helping you understand the materials of this unit
Textbook p.203 : from 10.1-1 to 10.1-4 all
Textbook p.204 : from 10.1-5 to 10.1-7 all
Unit 3. Link lists
Task 1: Read the following:
- Link lists
- Textbook: Link lists pp.204
Task 2: Do the following exercises:
These exercises are NOT homework questions.
They are for helping you understand the materials of this unit
Textbook p.208 : from 10.2-2 to 10.2-6 all
Textbook p.209 : 10.2-7, 10.2-8 all
Unit 4. Recursion
Task 1: Read the following:
- Recursion
- Textbook: The recursion-tree method pp.67
Task 2: Do the following exercises:
These exercises are NOT homework questions.
They are for helping you understand the materials of this unit
Textbook
Textbook
Unit 5. Binary search trees
Task 1: Read the following:
- Binary search trees
- Textbook:
Task 2: Do the following exercises:
These exercises are NOT homework questions.
They are for helping you understand the materials of this unit
Textbook
Textbook
Unit 6. Sorting (part one)
Task 1: Read the following:
- Sorting ...
Task 2: Do the following exercises:
These exercises are NOT homework questions.
They are for helping you understand the materials of this unit
Textbook
Textbook
Unit 7. Sorting (part two)
Task 1: Read the following:
Task 2: Do the following exercises:
These exercises are NOT homework questions.
They are for helping you understand the materials of this unit
Textbook
Textbook
Unit 8. Graphs (part one)
Task 1: Read the following:
- Textbook:
Task 2: Do the following exercises:
These exercises are NOT homework questions.
They are for helping you understand the materials of this unit
Textbook
Textbook
Unit 9. Graphs (part two)
Task 1: Read the following:
- Textbook:
Task 2: Do the following exercises:
These exercises are NOT homework questions.
They are for helping you understand the materials of this unit
Textbook
Textbook
Unit 10. Hashing (part one)
Task 1: Read the following:
- Textbook:
Task 2: Do the following exercises:
These exercises are NOT homework questions.
They are for helping you understand the materials of this unit
Textbook
Textbook
Unit 11. Hashing (part two)
Task 1: Read the following:
- Textbook:
Task 2: Do the following exercises:
These exercises are NOT homework questions.
They are for helping you understand the materials of this unit
Textbook
Textbook
Timetable
| WEEK |
TOPICS |
ASSIGNMENTS |
| 1 |
Introduction to Data Structure and Algorithms |
|
| 2 |
Stack and Queue |
Assignment problem 1 or Assignment problem 2 |
| 3 |
Linked lists |
|
| |
Submit homework 1 and 2 |
|
| 4 |
Recursion |
|
| 5 |
Binary search trees |
|
| |
Submit homework 3 and 4 |
Submit assignment problems 1 and 2 |
| 6 |
Sorting (part one) |
Assignment problem 3 or Assignment problem 4 |
| 7 |
Middle exam (from week 2 to week 5) |
|
| 8 |
Sorting (part two) |
|
| |
Submit homework 5 |
|
| 9 |
Graphs (part one) |
|
| 10 |
Graphs (part two) |
|
| |
Submit homework 6 |
|
| 11 |
Hashing (part one) |
Submit assignment problems 3 and 4 |
| 12 |
Hashing (part two) |
|
| |
Submit homework 7 |
|
| 13 |
Final exam |
|
Assignment problem
Assignment problem 1 - Depth First Search and The N-Queens Problem (4 weeks)
(See assignment problem link for details)
Assignment problem 2 - Greedy Search and The N-Queens Problem (4 weeks)
(See assignment problem link for details)
Assignment problem 3 - Finding a maximum weight matching in a weighted bipartite graph (6 weeks)
(See assignment problem link for details)
Assignment problem 4 - Stable marriage problem (6 weeks)
(See assignment problem link for details)
Exercises
Homework 1. Stack and Queue – 7 exercises
(See exercises link for details)
Homework 2. Linked lists – 4 exercises
(See exercises link for details)
Homework 3. Designing algorithms – 3 exercises
(See exercises link for details)
Homework 4. Binary Search Trees – 20 exercises
(See exercises link for details)
Homework 5. Sorting – 19 exercises
(See exercises link for details)
Homework 6. Graphs – 5 exercises
(See exercises link for details)
Homework 7. Hashing – 12 exercises
(See exercises link for details)