Data Structure Pt. 1

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What is the space complexity for deleting a linked list? a) O(1) b) O(n) c) Either O(1) or O(n) d) O(logn)

a) O(1)

The prefix form of A-B/ (C * D ^ E) is? a) -A/B*C^DE b) -A/BC*^DE c) -ABCD*^DE d) -/*^ACBDE

a) -A/B*C^DE

Which of the following is the most widely used external memory data structure? a) B-tree b) Red-black tree c) AVL tree d) Both AVL tree and Red-black tree

a) B-tree

Which of the following is not the application of stack? a) Data Transfer between two asynchronous process b) Compiler Syntax Analyzer c) Tracking of local variables at run time d) A parentheses balancing program

a) Data Transfer between two asynchronous process

In simple chaining, what data structure is appropriate? a) Doubly linked list b) Circular linked list c) Singly linked list d) Binary trees

a) Doubly linked list

What is the time complexity for converting decimal to binary numbers? a) O(1) b) O(n) c) O(logn) d) O(nlogn)

c) O(logn)

Which of the following is not the type of queue? a) Priority queue b) Circular queue c) Single ended queue d) Ordinary queue

c) Single ended queue

What differentiates a circular linked list from a normal linked list? a) You cannot have the 'next' pointer point to null in a circular linked list b) It is faster to traverse the circular linked list c) You may or may not have the 'next' pointer point to null in a circular linked list d) Head node is known in circular linked list

c) You may or may not have the 'next' pointer point to null in a circular linked list

What is the need for a circular queue? a) easier computations b) implement LIFO principle in queues c) effective usage of memory d) to delete elements based on priority

c) effective usage of memory

What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list? a) O(1) b) O(n) c) θ(n) d) θ(1)

c) θ(n)

Which type of data structure is a ternary heap? a) Hash b) Array c) Priority Stack d) Priority Queue

d) Priority Queue

The optimal data structure used to solve Tower of Hanoi is _________ a) Tree b) Heap c) Priority queue d) Stack

d) Stack

What are the disadvantages of arrays? a) Index value of an array can be negative b) Elements are sequentially accessed c) Data structure like queue or stack cannot be implemented d) There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size

d) There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size

If row-major order is used, how is the following matrix stored in memory? a b c d e f g h i a) ihgfedcba b) abcdefghi c) cfibehadg d) adgbehcfi

b) abcdefghi

What is the advantage of a hash table as a data structure? a) easy to implement b) faster access of data c) exhibit good locality of reference d) very efficient for less number of entries

b) faster access of data

What is the use of the bin data structure? a) to have efficient traversal b) to have efficient region query c) to have efficient deletion d) to have efficient insertion

b) to have efficient region query

Which of the following is not a disadvantage to the usage of array? a) Fixed size b) There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size c) Insertion based on position d) Accessing elements at specified positions

d) Accessing elements at specified positions

What are the applications of dequeue? a) A-Steal job scheduling algorithm b) Can be used as both stack and queue c) To find the maximum of all sub arrays of size k d) All of the mentioned

d) All of the mentioned

Which of the following application makes use of a circular linked list? a) Recursive function calls b) Undo operation in a text editor c) Implement Hash Tables d) Allocating CPU to resources

d) Allocating CPU to resources

What is a bit array? a) Data structure that compactly stores bits b) Data structure for representing arrays of records c) Array in which elements are not present in continuous locations d) An array in which most of the elements have the same value

a) Data structure that compactly stores bits

A linear collection of data elements where the linear node is given by means of pointer is called? a) Linked list b) Node list c) Primitive list d) Unordered list

a) Linked list

What is the time complexity of searching for an element in a circular linked list? a) O(n) b) O(nlogn) c) O(1) d) O(n2)

a) O(n)

What data structure would you mostly likely see in non recursive implementation of a recursive algorithm? a) Stack b) Linked List c) Tree d) Queue

a) Stack

Which data structure is used for implementing recursion? a) Stack b) Queue c) List d) Array

a) Stack

Identify the infix expression from the list of options given below. a) a/b+(c-d) b) abc*+d+ab+cd+*ce-f- c) ab-c- d) +ab

a) a/b+(c-d)

What is the order of a matrix? a) number of rows X number of columns b) number of columns X number of rows c) number of rows X number of rows d) number of columns X number of columns

a) number of rows X number of columns

How many passes does the evaluation of infix expression algorithm makes through the input? a) one b) two c) three d) four

a) one

Which is the most appropriate data structure for reversing a word? a) stack b) queue c) graph d) tree

a) stack

What is the value of the postfix expression 6 3 2 4 + - *? a) 74 b) -18 c) 22 d) 40

b) -18

Express -15 as a 6-bit signed binary number. a) 001111 b) 101111 c) 101110 d) 001110

b) 101111

Which of the following points is/are not true about Linked List data structure when it is compared with an array? a) Random access is not allowed in a typical implementation of Linked Lists b) Access of elements in linked list takes less time than compared to arrays c) Arrays have better cache locality that can make them better in terms of performance d) It is easy to insert and delete elements in Linked List

b) Access of elements in linked list takes less time than compared to arrays

Which of the following tree data structures is not a balanced binary tree? a) Splay tree b) B-tree c) AVL tree d) Red-black tree

b) B-tree

A data structure in which elements can be inserted or deleted at/from both ends but not in the middle is? a) Priority queue b) Dequeue c) Circular queue d) Queue

b) Dequeue

Which algorithm is used in the top tree data structure? a) Backtracking b) Divide and Conquer c) Branch d) Greedy

b) Divide and Conquer

Consider a small circular linked list. How to detect the presence of cycles in this list effectively? a) Keep one node as head and traverse another temp node till the end to check if its 'next points to head b) Have fast and slow pointers with the fast pointer advancing two nodes at a time and slow pointer advancing by one node at a time c) Cannot determine, you have to pre-define if the list contains cycles d) Circular linked list itself represents a cycle. So no new cycles cannot be generated

b) Have fast and slow pointers with the fast pointer advancing two nodes at a time and slow pointer advancing by one node at a time

Which of the following statement is incorrect with respect to evaluation of infix expression algorithm? a) Operand is pushed on to the stack b) If the precedence of operator is higher, pop two operands and evaluate c) If the precedence of operator is lower, pop two operands and evaluate d) The result is pushed on to the operand stack

b) If the precedence of operator is higher, pop two operands and evaluate

Matrix A when multiplied with Matrix C gives the Identity matrix I, what is C? a) Identity matrix b) Inverse of A c) Square of A d) Transpose of A

b) Inverse of A

Which of the following is the simplest data structure that supports range searching? a) AA-trees b) K-d trees c) Heaps d) binary search trees

b) K-d trees

The data structure required to check whether an expression contains a balanced parenthesis is? a) Queue b) Stack c) Tree d) Array

b) Stack

Which of the following statement(s) about stack data structure is/are NOT correct? a) Top of the Stack always contain the new node b) Stack is the FIFO data structure c) Null link is present in the last node at the bottom of the stack d) Linked List are used for implementing Stacks

b) Stack is the FIFO data structure

Which of the following is false about a circular linked list? a) Every node has a successor b) Time complexity of inserting a new node at the head of the list is O(1) c) Time complexity for deleting the last node is O(n) d) We can traverse the whole circular linked list by starting from any point

b) Time complexity of inserting a new node at the head of the list is O(1)

What is an AVL tree? a) a tree which is unbalanced and is a height balanced tree b) a tree which is balanced and is a height balanced tree c) a tree with atmost 3 children d) a tree with three children

b) a tree which is balanced and is a height balanced tree

How do you allocate a matrix using a single pointer in C?(r and c are the number of rows and columns respectively) a) int *arr = malloc(r * c * sizeof(int)); b) int *arr = (int *)malloc(r * c * sizeof(int)); c) int *arr = (int *)malloc(r + c * sizeof(int)); d) int *arr = (int *)malloc(r * c * sizeof(arr));

b) int *arr = (int *)malloc(r * c * sizeof(int));

How many stacks are required for applying evaluation of infix expression algorithm? a) one b) two c) three d) four

b) two

Which of the following data structure can provide efficient searching of the elements? a) binary search tree b) unordered lists c) 2-3 tree d) treap

c) 2-3 tree

Evaluate the following statement using infix evaluation algorithm and choose the correct answer. 1+2*3-2 a) 3 b) 6 c) 5 d) 4

c) 5

What is a dequeue? a) A queue implemented with both singly and doubly linked lists b) A queue with insert/delete defined for front side of the queue c) A queue with insert/delete defined for both front and rear ends of the queue d) A queue implemented with a doubly linked list

c) A queue with insert/delete defined for both front and rear ends of the queue

What is a data structure? a) A programming language b) A collection of algorithms c) A way to store and organize data d) A type of computer hardware

c) A way to store and organize data

Which of the following application makes use of a circular linked list? a) Undo operation in a text editor b) Recursive function calls c) Allocating CPU to resources d) Implement Hash Tables

c) Allocating CPU to resources

The concatenation of two lists can be performed in O(1) time. Which of the following variation of the linked list can be used? a) Singly linked list b) Doubly linked list c) Circular doubly linked list d) Array implementation of list

c) Circular doubly linked list

Which of the following property does not hold for matrix multiplication? a) Associative b) Distributive c) Commutative d) Additive Inverse

c) Commutative

What is the time complexity for searching a key or integer in Van Emde Boas data structure? a) O (M!) b) O (log M!) c) O (log (log M)) d) O (M2)

c) O (log (log M))

In linked list each node contains a minimum of two fields. One field is data field to store the data second field is? a) Pointer to character b) Pointer to integer c) Pointer to node d) Node

c) Pointer to node

Which data structure is based on the Last In First Out (LIFO) principle? a) Tree b) Linked List c) Stack d) Queue

c) Stack

Which data structure is needed to convert infix notation to postfix notation? a) Tree b) Branch c) Stack d) Queue

c) Stack

Which of the following is also known as Rope data structure? a) Linked List b) Array c) String d) Cord

d) Cord

What is the time complexity of inserting at the end in dynamic arrays? a) O(1) b) O(n) c) O(logn) d) Either O(1) or O(n)

d) Either O(1) or O(n)

Which of the following is an advantage of matrices? a) Internal complexity b) Searching through a matrix is complex c) Not space efficient d) Graph Plotting

d) Graph Plotting

The data structure required for Breadth First Traversal on a graph is? a) Array b) Stack c) Tree d) Queue

d) Queue

Which of these is not an application of a linked list? a) To implement file systems b) For separate chaining in hash-tables c) To implement non-binary trees d) Random Access of elements

d) Random Access of elements

Which of the following don't use matrices? a) In solving linear equations b) Image processing c) Graph theory d) Sorting numbers

d) Sorting numbers

Which of the following data structures can be used for parentheses matching? a) n-ary tree b) queue c) priority queue d) stack

d) stack

Which is the predefined method available in Java to convert decimal to binary numbers? a) toBinaryInteger(int) b) toBinaryValue(int) c) toBinaryNumber(int) d) toBinaryString(int)

d) toBinaryString(int)


Ensembles d'études connexes

Science test FILL IN THE BLANK😭

View Set

Chapter 5 Risk Analysis Assessing the risks of natural Hazards

View Set

The Square Root Function / Assignment

View Set