89% found this document useful (35 votes)
38K views

Degree Exit Exam Sample Questions

The document contains 18 multiple choice questions related to data structures and algorithms concepts like arrays, queues, stacks, sorting, trees, pointers, etc. Some key points addressed are: - Question 1 asks about valid pointer assignments for arrays and multi-dimensional arrays - Question 2 asks about the minimum number of deletions and additions needed to rearrange elements in a queue - Question 3 asks about the algorithm design technique used in quicksort - Question 4 asks about the worst case number of comparisons for merge sort
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
89% found this document useful (35 votes)
38K views

Degree Exit Exam Sample Questions

The document contains 18 multiple choice questions related to data structures and algorithms concepts like arrays, queues, stacks, sorting, trees, pointers, etc. Some key points addressed are: - Question 1 asks about valid pointer assignments for arrays and multi-dimensional arrays - Question 2 asks about the minimum number of deletions and additions needed to rearrange elements in a queue - Question 3 asks about the algorithm design technique used in quicksort - Question 4 asks about the worst case number of comparisons for merge sort
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/ 4

1. Given the following C++ statement, which of the following is true?

int A[4], B[3][3], *p,*t;

[A] p = &A[0]; t = B;
[B] p = A; t = B;
[C] p = A; t = &B[0][0];
[D] None of the above
2. The initial configuration of the queue is a,b,c,d (a is the front end). To get the
configuration d,c,b,a one needs a minimum of ?

[A] 2 deletions and 3 additions


[B] 3 additions and 2 deletions
[C] 3 deletions and 3 additions
[D] 3 deletions and 4 additions

3. Which of the following algorithm design technique is used in the quick sort algorithm?
[A] Dynamic programming
[B] Backtracking
[C] Divide and conquer
[D] Greedy method

4. Given two sorted lists of size m and n respectively. The number of comparisons needed in
the worst case by the merge sort algorithm will be?
[A] mn
[B] max(m,n)
[C] min(m,n)
[D] m+n-1

5. The following sequence of operation is performed on stack : push(1),push(2),pop,


push(1),push(2),pop, pop, pop, push(2),pop. The sequence of popped out values are ?
[A] 2,2,1,1,2
[B] 2,2,1,2,2
[C] 2,1,2,2,1
[D] 2,1,2,2,2

6. The postfix expression for * + a b - c d is?


[A] ab + cd - *
[B] ab cd + - *
[C] ab + cd * -
[D] ab + - cd *

7. If a variable is a pointer to a structure, then which of the following operator is used to


access data members of the structure through the pointer variable?
A.. B.&
C.* D.->
8. What would be the equivalent pointer expression for referring the array element a[i][j]
[k][l]

A.((((a+i)+j)+k)+l) B.*(*(*(*(a+i)+j)+k)+l)
C.(((a+i)+j)+k+l) D.((a+i)+j+k+l)
9. A pointer is
A.A keyword used to create variables
B.A variable that stores address of an instruction
C.A variable that stores address of other variable
D.All of the above
10. The operator used to get value at address stored in a pointer variable is
A.* B.&
C.&& D.||
11. Which of the following is not the required condition for binary search algorithm?
a. The list must be sorted
b. there should be the direct access to the middle element in any sublist
c. There must be mechanism to delete and/or insert elements in list
d. none of above
12. When inorder traversing a tree resulted E A C K F H D B G; the preorder traversal would
return
a. FAEKCDBHG
b. FAEKCDHGB
c. EAFKHDCBG
d. FEAKDCHBG
13. Inserting an item into the stack when stack is not full is called …………. Operation and
deletion of item from the stack, when stack is not empty is called ………..operation.
A) push, pop
B) pop, push
C) insert, delete
D) delete, insert
14. Given the following fragmented C++ program

Which of the following is not true?


A. The name of the structure is student.
B. The instance of the structure is student1 and student2.
C. The data members of the structure are name and marks.
D. cout<<student1->marks; is equivalent to cout<<(*student1).marks;
E. none of the above
15. The average Big O notation of quick sort is----------
A. O(n2)
B. O(nlogn)
C. 3n+1
D. None
16. “Make a pass across the data looking for the largest item, swap the largest with the last
item in the array” is the strategy of :
A. Selection sorting
B. Bubble sorting
C. Quick sorting
D. Insertion sorting
17. Linked list are not suitable data structure of which one of the following problems?
[A] Insertion sort
[B] Binary search
[C] Radix sort
[D] Polynomial manipulation
18. The number of possible ordered trees with three nodes A, B, C is?
[A] 16
[B] 12
[C] 6
[D] 10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy