In both midterms and the final exam, the marks will be 40% easy questions, 40% medium difficulty questions, and 20% challenging questions.
Easy questions
- You are asked to give the output of some easy-to-read code. For example the result of a sequence of stack operations, some nested loops, or a recursive function.
- You are asked to give the code for a problem we have covered in class. For example binary search, insertion sort, adding or removing an item to or from a linked list or an array
- You are asked a question that was the main point in a lab or assignment. For example when a default constructor is needed (related to lab1), or if a given code will lead to dangling pointer (related to lab2).
- You are asked to analyze the time or space complexity of an algorithm that is extremely similar to one that we have covered in class.
Medium questions
- You are asked to read a piece of code where there is some twist. For example in presence or absence of the keyword "virtual".
- You are asked to use an advanced feature of C++. For example to make a class/function generic, or make an interface that is an abstract class.
- You are asked to give the code for a non-trivial problem you have seen in the book/slides/labs/assignments. For example the code for copy constructor of a singly linked list (lab2).
- You are asked to give the code for a problem we haven't covered in class but is very similar to one we have. For example to give all permutations of {1...n} instead of all subsets of it.
- You are asked to analyze the time/space complexity of an arbitrary algorithm.
Challenging questions
- You are asked to solve any problem that is solvable with the topics we have covered. Any creativity question in your book can be an example of this sort of questions.
Have fun studying!