Data Structures and Algorithms (CS1020) Midterm May 2024 Question Paper

RV University Midterm exam for Data Structures and Algorithms (CS1020), held May 2024, semester 2, with 7 questions. Also searched as DSA, DS, ALGO. Last updated 2026-11-14.

Questions

  1. 1. Memory allocated during runtime is from
  2. 2. Study the below piece of code:includeincludedefine arrsize 3int main() {int myArray[10];int reallocarray = (int )realloc(myArray, sizeof(int) 2arrsize);if (reallocarray == NULL)printf(" %d is size memory chunk could not be allotted in heap by RE-ALLOC ,arrsize 2);elseprintf(" %d
  3. 3. In the original version of the Tower of Hanoi puzzle, as it was published in the 1890s by Edouard Lucas, a French mathematician, the world will end 'after 64 disks have been moved in this mystical tower. a) How many moves are made by the ( i^{th} ) largest disk (( 1 leq i leq n )
  4. 4. is the number of years it will take if monks living in this mystical tower could move one disk per minute. (Assume that monks do not eat, sleep, or die.). PART-B Question (Linked List Programming Question)
  5. 5. Complete the code for a DLL below to print output as:18 : Ahalya28 : Fatima38 : Mariaminclude include include typedef struct student{char name[10];int age;struct student prev;struct student next;}node;int main(){node head, newnode; //declare new pointers if necessarynewnode = (no
  6. 6. a) Rewrite the above program so that it becomes either a Singly Linked List or a Circular Double or Singly Linked List. b) Search for "Draupadi" in the list and print the resultc) Insert "Sarah" before "Mariam"d) Delete "Mariam"
  7. 7. Below is a 'C' Code using iteration for a particular program. Read and understand it. a) What does this program do? (1 Mark)b) Write its Recursive Version (2.5 Marks)c) Draw either the recursion call stack or recursion tree.include int Mystery(int array[], int x, int low, int hig

More Data Structures and Algorithms papers

Browse more RVU papers

RVU 2nd semester previous year question papers · RVU Midterm previous year question papers · RVU School of Computer Science and Engineering (SoCSE) question papers