0% found this document useful (0 votes)
113 views3 pages

Lab Exam External Questions PDF

This document provides instructions for an external exam on data structures using C. It includes 3 questions: 1) Write a program to implement a double stack within a single array, where one stack stores even numbers and the other stores odd numbers. 2) Write a program to accept numbers into a linked list and then split the list into two lists, one for odd numbers and one for even numbers. 3) Choose the correct option for 5 multiple choice questions related to binary trees, data storage, sorting algorithms, graph properties, and memory management.

Uploaded by

Pranjal Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
113 views3 pages

Lab Exam External Questions PDF

This document provides instructions for an external exam on data structures using C. It includes 3 questions: 1) Write a program to implement a double stack within a single array, where one stack stores even numbers and the other stores odd numbers. 2) Write a program to accept numbers into a linked list and then split the list into two lists, one for odd numbers and one for even numbers. 3) Choose the correct option for 5 multiple choice questions related to binary trees, data storage, sorting algorithms, graph properties, and memory management.

Uploaded by

Pranjal Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

END SEM LAB EXTERNAL EXAMINATION

Branch: Computer Science & Engineering , AI , AIR


No. of Credits: 4
Date:-11/12/2020
Data Structure Using C (CSIT-124)
Class:-B.Tech (H) Year: 2nd Semester: 3rd
Time: 2.5 hr
Instructions:
 Answer all the questions and all part of a particular question at one place only.
 Answer script will be handwritten.
 Take screenshot of the program that you have implemented.
 Mail all the documents(Handwritten answer script and two screenshot of
output as an attachment of the mail ) to amityoddsemassignment@gmail.com
 Please mention your name, enrollment number, branch, section, year, date of
exam, semester, subject at the top section of the answercript.
 Subject of the mail will be your name and enrolment number with subject
code which is CSIT-124

1.Generally a program requires two stack containing the same type of items such as integers. If
the two stacks are stored in separate arrays. Then one stack might overflow while there was
considerable unused space in the other. A neat way to avoid the problem is to put all the space
in one array and let one stack grow from one end of the array and the other stack start at the
other end and grow in opposite direction i.e., toward the first stack, in this way, if one stack
turns out to be large and the other small, then they will still both fit, and there will be no
overflow until all the space is actually used. Declare a new structure type Double stack that
includes the array and the two indices top A and top B, and write a program in C which
contains the functions Push A, Push B, Pop A and Pop B to handle the two stacks within one
DoubleStack. Now in this program the double stack will consists of odd and ever integers. You
can use top A to take even integers and top B to push odd integers. The odd and even numbers
will be user inputs.

2. Write a program in c to accept n numbers from user to create a single linked list. After that
splits the linked list into two linked lists, so that odd numbers go to the first list, and all even-
numbers go to the second list.
3. Choose the correct options from the following.

a. If a node having two children is deleted from a binary tree, it is replaced by its

 A ) Inorder predecessor

 B ) Inorder successor

 C ) Preorder predecessor

 D ) Post order

b. The process of accessing data stored in a tape is similar to manipulating data on a

 A ) Stack

 B ) Queue

 C ) List

 D ) Heap

c. You have to sort a list L consisting of a sorted list followed by a few “random” elements.Which of the following sorting
methods would be especially suitable for such a task?

 A ) Bubble sort

 B ) Selection sort

 C ) Quick sort

 D ) Insertion sort

d. For an undirected graph with n vertices and e edges, the sum of the degree of each vertex is equal to

 A ) 2n

 B ) (2n-1)/2

 C) 2e

 D ) e2/2

e. The OS of a computer may periodically collect all the free memory space to form contiguous block of free space. This
is called

 A ) Concatenation

 B ) Garbage collection

 C ) Collision

 D ) Dynamic Memory Allocation

You might also like