View on GitHub

CS2040C

This is the lab related content for the module CS2040C (Data structures and Algorithms)

Lab 05

Here is a pdf version of the ppt I covered during the lab. And the codes that I (skimmed through) / (demonstrated live).

content.pdf (The pdf version of the ppt shown)

priority_queue_stl.cpp (Example usage of STL Priority Queue)

tree.cpp (Methods for creating and traversing a binary tree)

Challenge Questions -

Q) How can you use priority_queue to sort an array of integers.

Solution TBA

Q) When you are implementing the binary tree, try to create a method bool isDescendent(x, y) which returns true, if x is in the subtree of y, otherwise false.

Solution TBA