Questions
Practice questions with model answers, filterable by type.
- objective · 1 marksWhat is the worst-case time complexity of Quick Sort algorithm? (a) O(n) (b) O(n log n) (c) O(n^2) (d) O(log n)
- short · 5 marksDifferentiate between Linear Queue and Circular Queue. Explain how modulo arithmetic prevents false overflow.
- objective · 1 marksWhich heuristic search algorithm evaluates nodes using f(n) = g(n) + h(n)? (a) Breadth-First Search (b) A* Search (c) Depth-First Search (d) Hill Climbing
- short · 5 marksWhat is an admissible heuristic? Why is admissibility required for optimality in A* tree search?
- long · 5 marksState and prove the principle of conservation of linear momentum using Newtons second and third laws of motion.
- objective · 1 marksWhich of the following is an invalid variable name in C? (a) _salary (b) 1st_rank (c) total_sum (d) age2
- objective · 1 marksWhat is the return type of the `malloc()` function in C? (a) `int*` (b) `char*` (c) `void*` (d) `float*`
- short · 5 marksExplain the difference between call by value and call by reference in C with suitable code snippets.
- short · 5 marksWhat is recursion? Write a recursive function in C to calculate the factorial of a positive integer.
- long · 10 marksExplain dynamic memory allocation in C. Differentiate between `malloc()` and `calloc()`. Write a C program to dynamically allocate memory for N integers, sort them in ascending order, and free the memory.