Breaking News
Home / Amcat / AMCAT Computer Programming : Data Structures Arrays, Linked Lists,Questions And Answer

# AMCAT Computer Programming : Data Structures Arrays, Linked Lists,Questions And Answer

1. Queues serve a major role in
A) simulation of recursion
B) simulation of arbitrary linked list
C) simulation of limited resource allocation
D) expression evaluation

2. The average search time of hashing with linear probing will be less if the load
factor
A) is far less than one
B) equals one
C) is far greater than one
D) none of these

3. Number of vertices of odd degree in a graph is
A) is always even
B) always odd
C) either even or odd
D) always zero

4. The algorithm design technique used in the quick sort algorithm is
A) Dynamic programming
B) Back tracking
C) Divide and conquer
D) Greedy Search

5. Linked lists are not suitable for
A) Insertion sort
B) Binary search
C) Queue implementation
D) None of these

6. A connected graph is the one which
A) Cannot be partitioned without removing an edge
B) Can be partitioned without removing an edge
C) does not contain a cycle
D) Has even number of vertices

7. Stack is useful for implementing
C) recursion
D) none of these

8. Which of the following is useful in traversing a given graph by breadth first
search?
A) stack
B) set
C) list
D) queue

9. Which of the following is useful in implementing quick sort?
A) stack
B) set
C) list
D) queue

10. Which of the following abstract data types can be used to represent a manyto-many
relation?
A) Tree
B) Stack
C) Graph
D) Queue

the first and last node are stored in variables firstA and lastA for list A
and firstB and lastB for list B. Given the address of a node is given in the
variable node, the element stored in the node can be accessed by the
statement node->data and the address to the next node can be accessed by node-
>next. Pankaj wants to append list B at end of list A. Which of the following
statements should he use?
A) lastB -> next = firstA
B) lastA = firstB
C) lastA->next = firstB
D) lastB = firstA

12. Which of the following sorting algorithms yield approximately the same worstcase
and average-case running time behaviour in O (n log n)?
A) Bubble sort and Selection sort
B) Heap sort and Merge sort
C) Quick sort and Radix sort
D) Tree sort and Median-of-3 Quick sort

13. A complete binary tree with 5 levels has how many nodes? (Root is Level 1)
A) 15
B) 25
C) 63
D) 31

14. The maximum number of nodes on level I of a binary tree is which of the
following? (Root is Level 1)
A) 2l-1
B) 3l-1
C) 2l
D) 2l – 1

15. Consider an array on which bubble sort is used. The bubble sort would
compare the element A[x] to which of the following elements in a single iteration.
A) A [x+1] B) A [x+2] C) A [x+2x] D) All of these.

16. In an implementation of a linked list, each node contains data and address.
Which of the following could the address field possibly contain?
A) Address of next node in sequence

17. Surbhi wants to implement a particular data structure using a static array. She
uses the concept of circular list to implement the data structure, because this allows
her to efficiently use all fields of the array. Which data structure is Surbhi
implementing?
A) a stack
B) a queue
C) Binary Tree
D) None of these

18. Which of the following is a bad implementation for a queue?
A) Circular List
D) Linear Static Array

19. Which of the following statements are true about a doubly-linked list?
A) it may be either linear or circular
B) it must contain a header node
C) it will occupy same memory space as that of linear linked list, both having
same number of nodes
D) None of these

20. Which of the following data structure may give overflow error, even though
the current number of element in it is less than its size ?
A) Queue implemented in a linear array
B) Queue implemented in a circularly connected array
C) Stack implemented in a linear array
D) none of these