time complexityarrays vs linked listsstack operationsqueue implementation
Predicted exam-style question
Your uploaded notes cover data structures and algorithms. Which exam-style question would likely test the time complexity advantage of a linked list over an array?
AWhat is the time complexity of accessing the nth element in an array?
BInserting a node at the head of a singly linked list has what time complexity, and why is this faster than inserting at the beginning of an array?
CWhich data structure uses LIFO (Last In, First Out) ordering for its operations?
DHow is a queue typically implemented using two stacks?
Why this answer
Inserting at the head of a linked list is O(1) because it only requires updating the head pointer and the new node’s next reference. Inserting at the beginning of an array is O(n) because all existing elements must shift one position. The other options address array access, stack ordering, and queue implementation.
Sample course materialCS_Algorithms_Sorting.pdf
Course material preview
Sorting algorithms and complexity analysis
merge sortquick sortbest/worst casedivide and conquer
Predicted exam-style question
Your uploaded notes cover sorting algorithms and complexity analysis. Which exam-style question would likely test why merge sort has a guaranteed O(n log n) worst-case time complexity?
ATrace the execution of bubble sort on the array [5, 3, 8, 1] and count the number of comparisons.
BExplain why merge sort always runs in O(n log n) time regardless of input order, and contrast this with quick sort's worst case.
CWhat is the space complexity of merge sort, and why does it require additional memory?
DDescribe the divide-and-conquer paradigm and give an example not related to sorting.
Why this answer
Merge sort divides the array in half at each level (log n levels) and merges in O(n) per level, guaranteeing O(n log n) regardless of input. Quick sort's worst case is O(n²) when the pivot is poorly chosen. Option B requires explaining this distinction. The other options address bubble sort tracing, space complexity, and the general paradigm.
Your uploaded notes cover object-oriented programming and design patterns. Which exam-style question would likely test the concept of polymorphism?
ADefine inheritance and explain how it promotes code reuse in a class hierarchy.
BA superclass reference points to a subclass object. When a method is called, the subclass version executes. What OOP principle does this demonstrate, and why is it useful?
CDescribe the singleton pattern and explain when it should be used.
DWhat is the difference between an abstract class and an interface?
Why this answer
Polymorphism allows a superclass reference to invoke the overridden method of the actual subclass object at runtime. This enables flexible, extensible code where new subclasses work with existing interfaces. The other options address inheritance, the singleton pattern, and abstract classes vs interfaces.
Sample course materialCS_Operating_Systems.pdf
Course material preview
Operating systems and process management
process schedulingdeadlockmutex and semaphorescontext switching
Predicted exam-style question
Your uploaded notes cover operating systems and process management. Which exam-style question would likely test the conditions necessary for deadlock to occur?
AExplain the difference between a process and a thread.
BDescribe the round-robin scheduling algorithm and calculate the average waiting time for a given set of processes.
CList the four necessary conditions for deadlock (mutual exclusion, hold and wait, no preemption, circular wait) and explain how eliminating any one condition prevents deadlock.
DWhat is the purpose of a context switch, and what are its performance costs?
Why this answer
Deadlock requires all four Coffman conditions simultaneously. Eliminating any one condition breaks the possibility of deadlock. Option C requires listing and reasoning about these conditions. The other options address process vs thread, round-robin scheduling, and context switching.
Frequently Asked Questions
Upload your own material
Get exam-style practice questions from your own course material.