Designing QT applications for visualization of data structures
- A simple stack application in
QT. Download the files into a local directory (under Windows),
compile and execute.
- Read and understand the code. Class discussion.
- The same example QT Stack with debugging.
Download the files into a local directory (under Windows),
compile and execute. Read and understand the code. Class discussion.
- In class exercise: modify it to work like a queue application.
Notice that this should be just a visualization of the queue behavior,
not an actual circular queue implementation.
- Redo the entire application design.
If time allows, start new topic:
Lists, pointers and dynamic memory alocation
- Dynamic memory allocation: when having an upper bound on the allocated
memory is not good (e.g. for stacks and queues). When space is allocated and
deallocated in an unpredictable fashion (as opposed to stacks and queues).
- Linked lists: motivation, definition, operations: insert, delete, empty.
- Informally drawing lists. Box representation.
- Implementing a node of a list in C/C++: struct and typedef; pointers; arrow
To be continued next time with:
- Allocating a new node in C/C++: the new operator.
- Discussion of subtleties in implementing list operations. The
head of a list.
- Implementation of the operations on lists: insert,
delete, empty, etc. Implementation of the Linked List ADT.
- Next week: applications of lists, and: pointers, pointers, pointers...