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

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

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

AMCAT Computer Programming : Data Structures 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

Correct Answer : C

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

Correct Answer : A

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

Correct Answer : A

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

Correct Answer : C

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

Correct Answer : B

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

Correct Answer : A

7. Stack is useful for implementing
A) radix search
B) breadth first search
C) recursion
D) none of these

Correct Answer : C

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

Correct Answer : D

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

Correct Answer : A

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

Correct Answer : C

11. Two lists, A and B are implemented as singly linked link-lists. The address of
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

Correct Answer : C

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

Correct Answer : B

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

Correct Answer : D

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

Correct Answer : A

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.

Correct Answer : A

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
B) It’s own address
C) Address of last node
D) Address of first node

Correct Answer : A

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

Correct Answer : B

18. Which of the following is a bad implementation for a queue?
A) Circular List
B) Doubly linked list
C) Singly linked List
D) Linear Static Array

Correct Answer : D

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

Correct Answer : A

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

Correct Answer : A

 

Check Also

AMCAT Logical Reasoning Previous Paper

AMCAT Logical Reasoning Previous Questions And Answers 1:  Statement : Nearly 25% of drivers who …

Leave a Reply

Your email address will not be published. Required fields are marked *