-
Basic information, updated April 26, 2006 (Hannu
Laine)
-
Algorithms and Datastructures C0197 (CAP04)
You should register to the course using WinhaWille.
The identification code of the course is C0197 and the implementation
code
is CAP04.
The most important issue of the course is to learn to understand
the
significance of abstraction, genericity and sw-components and to
learn to use them effectively in programming. A view of component
developer
and a view of component user are considered. The problematics of
developing
generic reusable software components is studied. The students learn to
develop reusable software components using mainly C-language. The
concept
of abstract data type (ADT) is used. The concept of ADT is quite a
powerfull
method in achieving the genericity and reusability. The weaknesses of
these
kind of implemantations are analyzed and tools for improving them are
found
in C++. Then a class is used to implement ADTs. This is the way the
students
learn to understand thoroughly the essence of the object oriented
approach.
Features of C and C++ are compared to eachother considering the tools
they
offer for abstraction and generic programming. The classic ADT:s like
lists,
stacks, queues and trees are studied. Different implementations (with
identical
interfaces) are compared. Their use in applications is demonstrated and
students learn to recognize the situations where to use these generic
components
rather than to start programming from scratch. Template classes,
container
classes and iterators are discussed because they are concepts closely
connected
to topics described above.
Recursion is also thoroughly studied. Recursion in definitions, in
problem
solving and as a programming technique is studied. How recursive
function
is executed in the processor is examined. The sorting and searching
methods
are studied as an example of algorithm analysis. The genericity aspects
are consired also in this context.
[ General
| Main
topics | Record | Course
material | Exercises |
Teamwork
excercise | Exam ]
General
information
- The course is taught during third and fourth period of the third
year
- The course is 4.5 study points ( ECTS)
- Lectures 2 h / week ( 28 hours together)
- Labs 2 h / week (28 hours together)
- One teamwork exercise (estimated effort for student 30
hours)
- Self study (estimated effort for student 30 hours)
- Exam at the end of the course (3 hours)
Main topics
The preliminary list of main topics is below.
- Introduction, main topics, algorithm
- Abstraction, procedure abstraction / data abstraction
- Abstract Data Type (ADT)
- Using software components
- Implementation with C and C++ (class)
- List : Definition and use
- List : various implementions
- Stack: definition, usage, implementations
- Queue: definition, usage, implementations
- SW Component hierarchies
- Disadvantages of array implementation
- Dynamically allocated implementations for List, stack and queue
- Other linked structures (circularly linked list, double linked
list,
sparse
matrix, ...)
- More about genericity
- Classes, operator overloading and templates
- More about C++ (comparisons to C)
- Container classes
- Iterators
- Summary of software components
- Recursion in defintions and in problem solving
- Recursive functions (comparison to reentrant functions)
- Sorting methods
- Comparison of sorting methods
- Searching methods
- Seqential, Binary, Hashing
- Trees
- Binary search tree
The history of
topics
of lectures
You can find the list of topic titles, which have been discussed each
week on "theory" classes by clicking the following link.
Course
material
Part
1 ( Algorithm and Abstraction
Part 4 ( Dynamic
data structures
)
Example 1 (Allocating
space for dynamic arrays),
Example 2 (Stack
implemention
with a dynamic array as storage structure),
Example3 (Step by step approach to
dynamically allocated (dynamically)
linked list:
Case 1 ,
Case
2 ,
Case 3 ,
Case
4 )
Example 4 (Stack
implementation
with a dynamically linked storage structure),
Example 5 (Queue
implementation with a dynamically linked storage structure)
Example 6
(Stack
implementation as class, dynamically linked storage structure is still
used)
Part 5 (
Function pointers
)
Part 6 ( More
linked
structures )
Part 7 ( Recursion )
Example 1
(Recursive operation functions for a linked list)
Example 2
(Traversing
a directory tree of disk files)
Exercises
There are about fourteen lab excercises during the course. Some of
them are voluntary additional tasks (marked with E, standing for extra)
Teamwork
Exercise
You can find the description of the
teamwork exercise
here
and corresponding material file
search_material.txt.
The teamwork exercise
description also includes some
instructions and hints for the teamwork. The recommended number of
students in one team is
three.
One goal of this is to exercise working in teams and working according
the principles of real project. Thus it is necessary to divide the work
into pieces, which are relatively independent from each other. It is
also
necessary to compose a plan for the project to get it to proceed
smoothly. The plan contains at least a list of subtasks, the timetable
and responsibility chart (who is responsible for what task).
More
instructions for project work in this link.
Exam
The examination is held on Wednesday, May 10 at 12.00 in the room
1.124.