Follow and like us on our Facebook page where we post on the new release subject and answering tips and tricks to help save your time so that you can never feel stuck again.
Shortcut

Ctrl + F is the shortcut in your browser or operating system that allows you to find words or questions quickly.

Ctrl + Tab to move to the next tab to the right and Ctrl + Shift + Tab to move to the next tab to the left.

On a phone or tablet, tap the menu icon in the upper-right corner of the window; Select "Find in Page" to search a question.

Share Us

Sharing is Caring

It's the biggest motivation to help us to make the site better by sharing this to your friends or classmates.

# Data Structures and Algorithms

Is a collection of steps to solve a particular problem. Learning data structures and algorithms allow us to write efficient and optimized computer programs.

## meta types

In ___________ we specify an object that is used as a key, and the value we want to associate to that key.

• HASH
• HASHING
• HASTABLE

The method used by card sorter.

• Heap
• Quick
• Insertion

Which of the following is/are the levels of implementation of data structure?

• Implementation level
• Abstract level
• All of these
• Application level

Deletion operation is done using __________ in a queue.

• top
• rear
• list
• front

An MD5 hash function encodes a string of information and encodes it into a___bit fingerprint.

• 128
• 256
• 64

___________ sorting algorithm is frequently used when n is small, where n is the total number of elements.

• Heap
• Bubble
• Insertion
• Quick

Eulerian refers to the Swiss mathematician _____Euler, who invented graph theory in the 18th century.

• LEONHARD
• FLLOYD
• DAMSCUS

Dijkstra's algorithm works correctly, because all edge weights are non-________, and the vertex with the least shortest-path estimate is always chosen.

• NEGATIVE
• POSITIVE
• ZERO

This is the term used to delete an element from the stack.

• Pull
• Push
• Pop
• Pump

Kruskal's Algorithm : performs better in typical situations (sparse graphs) because it uses simpler data structures. Prim's Algorithm : is significantly ___the limit when you've got a really dense graph with many more edges than vertices.

• FASTER
• SLOWER
• AT REST

Graph G is _____________ if for any pair u, v of nodes in G, there is a path from u to v or path from v to u.

• Widely connected
• Directly connected
• Unliterally connected
• Literally connected

Which indicates pre-order traversal?

• Left sub-tree, Right sub-tree and root
• Root, Left sub-tree, Right sub-tree
• Right sub-tree, Left sub-tree and root
• Right sub-tree, Root, Left sub-tree

Which data structure is used in breadth first search of a graph to hold nodes?

• Tree
• Queue
• Stack
• Array

This form of access is used to add/remove nodes from a stack.

• Both of these
• LIFO
• FIFO
• None of these

__________________ is putting an element in the appropriate place in a sorted list yields a larger sorted order list.

• selection
• extraction
• insertion
• distribution

A hash______ is a data structure that is used to store keys/value pairs.

• TABLE
• SET
• PATH

These are binary trees with threads.

• Pointer trees
• Special trees
• Special pointer trees

What is a run list?

• number of elements having same value
• number of records
• small batches of records from a file
• number of files in external storage

Identify the data structure which allows deletions at both ends of the list but insertion at only one end.

• Output restricted dequeue
• Priority queues
• Stack
• Input restricted dequeue

Bellman Ford algorithm is useful in finding shortest path from a given source vertex to all the other vertices even if the graph contains a _______ weight edge.

• ZERO
• POSITIVE
• NEGATIVE

Dynamic programming is a method of solving complex problems by breaking them down into simpler steps.

• BOTH A AND B
• YES
• NO

Which is the pointer associated with the stack?

• FRONT
• TOP
• FIRST
• REAR

Indexing the ________________ element in the list is not possible in linked lists.

• middle
• first
• anywhere in between
• last

_________ algorithms work by recursively constructing a set of objects from the smallest possible constituent parts.

• BEARD
• GREEDY
• SASH

The worst case occurs in linear search algorithm when ________________.

• Item is the last element in the array or item is not there at all
• Item is not in the array at all
• Item is somewhere in the middle of the array
• Item is the last element in the array

In the linked representation of the stack, __________ pointer behaves as the top pointer variable of stack.

• Start
• Begin
• Stop
• Avail

What does the sequential representation of binary trees use?

• Array with pointers
• Single linear array
• Two dimensional arrays
• Three dimensional arrays

This indicates the end of the list.

• Sentinel
• End pointer
• Guard
• Last pointer

Path Matrix in graph theory is a matrix sized ___ , where n is the number of vertices of the graph.

• n*n
• n*1
• n*2

A hash function that returns a unique hash number is called a _______hash function.

• SYSTEMATIC
• STABLE
• UNIVERSAL

In a graph, if e=[u,v], then u and v are called _______________

• All of the choices
• Neighbors
• End points of e

A connected graph T without any cycles is called ________________.

• free graph
• circular graph
• non-cycle graph
• no cycle graph

This is the insertion operation in the stack.

• top
• push
• insert
• pop

If the number of records to be sorted is small, then __________ sorting can be efficient.

• Selection
• Merge
• Bubble
• Heap

The root of a tree is the node that has no ancestors.

• True
• False

This is very useful in situation when data have to be stored and then retrieved in reverse order.

• queue
• list
• stack

Each node in singly linked list has _______ fields.

• 4
• 2
• 1
• 3

A pointer variable which contains the location at the top element of the stack.

• Final
• Last
• End
• Top

A program to keep track of the soccer teams in a city tournament

• Graph
• Binary search tree
• Stack
• Queue
• Tree

Which is the pointer associated with the availability list?

• REAR
• FIRST
• TOP
• AVAIL

An electronic address book ordered by name

• Queue
• Tree
• Binary search tree
• Graph
• Stack

Which of the following data structure is non-linear type?

• Lists
• Stacks
• Graph
• Strings

A word processor to have a PF key that causes the preceding command to be redisplayed. Every time the PF key is pressed, the program is to show the command that preceded the one currently displayed

• Binary search tree
• Stack
• Tree
• Queue
• Graph

_____Algorithm : is significantly faster in the limit when you've got a really dense graph with many more edges than vertices.

• FLLOYD
• KRUSKAL'S
• PRIM'S

Herder node is used as sentinel in __________________.

• Binary tree
• Stacks
• Graphs
• Queues

Which of the following is two way lists?

• List traversed in two directions

In a graph, the vertices represent the items being modeled.

• True
• False

Which of the following is an application of stack?

• all of these
• infix to postfix
• finding factorial
• tower of Hanoi

A program to keep track of patients as they check into a medical clinic, assigning patients to doctors on a first-come, first-served basis.

• Tree
• Binary search tree
• Queue
• Stack
• Graph

The operation of processing each element in the list is known as ________________.

• merging
• sorting
• inserting
• traversal

Which data structure is suitable to represent the hierarchal relationship between elements?

• Tree
• Dequeue
• Priority
• Graph

Draw the binary search tree whose elements are inserted in the following order: 50 72 96 94 107 26 12 11 9 2 10 25 51 16 17 95 If Print is applied to the tree formed above, in which order would the elements be printed?

• 2 9 10 11 12 16 17 25 26 50 51 72 94 95 96 107

A directed general-graph is a general-graph in which the set E is the set of ordered pairs of vertices.

• TRUE
• FALSE
• NONE OF THE ABOVE

The hash table should be an array with length about _ times the maximum number of keys that will actually be in the table, and. Size of hash table array should be a prime number.

• 1
• 1.56
• 1.3

_______programming is a method of solving complex problems by breaking them down into simpler steps.

• DEFINED
• SYSTEMATIC
• DYNAMIC

Which of the following data structure can't store the non-homogeneous data elements?

• Arrays
• Pointers
• Records
• Stacks

A program to keep track of family relationships

• Stack
• Binary search tree
• Tree
• Queue
• Graph

Which data structure allows deleting data elements from and inserting at rear?

• stacks
• queues
• binary search tree
• dequeues

The complexity of merge sort algorithm.

• O(n2)
• O(logn)
• O(n logn)
• ONo

A queue displays LIFO behavior.

• True
• False

A graph is a picture designed to express words, particularly the connection between two or more quantities.

• TRUE
• NO, IT MUST BE ONE QUANTITY ONLY
• FALSE

A graph consists of a set of nodes or vertices together with a set of edges or arcs where each edge joins two ______.

• POINTS
• VERTEX
• VERTICES

Value of first linked list index is _______________.

• 0
• -1
• 2
• 1
• 0 (zero)

Stack follows the strategy of ________________.

• FIFO
• LIFO
• RANDOM
• LRU

A ________ is a data structure that is used to store keys/value pairs.

• HASH LOOP
• HASH ALGORITHM
• HASH TABLE

This form of access is used to add and remove nodes from a queue.

• LIFO, Last In First Out
• FIFO, First In First Out
• Both of these
• None of these

Which of the following is true about the characteristics of abstract data types? i. It exports a type. ii. It exports a set of operations.

• False, True
• True, False
• True, True
• False, False

Linked representation of binary tree needs ______ parallel arrays.

• 3
• 2
• 5
• 4

On average, searching in a binary search tree is faster than searching in a list.

• True
• False

This is the operation of processing each element in the list.

• merging
• traversal
• sorting
• inserting

____________________ is not the component of data structure.

• Operations
• Storage structures
• None of these
• Algorithms

A leaf in a tree is a node with no children.

• True
• False

Sorting algorithm can be characterized as ________________.

• None of these
• Both of the choices
• Simple algorithm which require the order of n2 comparisons to sort n items
• Sophisticated algorithms that require the O(nlog2n) comparisons to sort items

In linked representation of stack, ___________ fields hold the elements of the stack.

• NULL
• INFO
• TOP

Which of the following names does not relate to stacks?

• Push down lists
• FIFO lists
• Piles
• LIFO lists

This is a terminal node in a binary tree.

• Child
• Leaf
• Branch
• Root

A binary search cannot be applied to a tree.

• True
• False

The term push and pop is related to _____________.

• stacks
• trees
• lists
• array

Another name for directed graph.

• Direct graph
• Dir-graph
• Diregraph
• Digraph

Breadth-____-search is the algorithm that will find shortest paths in an unweighted graph.

• THIRD
• FIRST
• SECOND

What happens when you push a new node onto a stack?

• No changes happen
• The new node is placed at the back of the linked list
• The new node is placed at the middle of the linked list
• The new node is placed at the front of the linked list

The value in the right child of a node (if it exists) in a binary search tree will be greater than the value in the node itself.

• True
• False

This refers to a linear collection of data items.

• Edge
• Tree
• List
• Graph

Trees are ________ if they are similar and have the same contents at corresponding nodes.

• carbon copy
• duplicate
• copies
• replica

A simple graph may be either ____________.

• CONNECTED
• DISCONNECTED
• BOTH A AND B

In an extended binary tree, nodes with 2 children are called _________________.

• Interior node
• Internal node
• Domestic node
• Inner node

The complexity of bubble sort algorithm.

• ONo
• O(n2)
• O(logn)
• O(n logn)

In binary trees, nodes with no successor are called _______________.

• End nodes
• Last nodes
• Final nodes
• Terminal nodes

A bank simulation of its teller operation to see how waiting times would be affected by adding another teller.

• Queue
• Graph
• Binary search tree
• Stack
• Tree

A ________ is a data structure that has two types of elements, vertices and edges.

• ALGORITHM
• HASH
• GRAPH

Hashing is also used in encryption.

• NO, IT IS USE FOR TAPPING
• NO
• YES

An ______hash function encodes a string of information and encodes it into a 128-bit fingerprint.

• MD1
• MD3
• MD5

_____________ order is the best possible for array sorting algorithm which sorts n item.

• O(logn)
• O(n logn)
• O(n+logn)
• O(n2)

Inserting an item into the stack when stack is not full is called ____________ while operation and deletion of item from the stack, when stack is not empty is called ________________ operation.

• push, pop
• pop, push
• delete, insert
• insert, delete

A linear list in which the pointer points only to the successive node.

• none of these

A linear list in which the last node points to the first node.

• none of these

The _______ algorithm is a graph search algorithm that finds the shortest path between a given source vertex and all other vertices in the graph.

• BELLMAN-FORD
• DIJKSTRA
• FORD

A list may be linear or nonlinear, depending on its implementation.

• True
• False

A program to maintain the routes in an airline.

• Tree
• Stack
• Graph
• Queue
• Binary search tree

Which of the following data structures is linear type?

• Binary tree
• Stack
• Graph
• Trees

A graph is a collection of points, called vertices, and line segments connecting those points, called _______.

• ANGLES
• EDGES
• POINTS

What is a queue?

• LOFI
• LIFO
• FILO
• FIFO

This is a binary tree whose every node has either zero or two children.

• complete binary tree
• binary search tree
• extended binary tree
• data structure

_____matrix in graph theory is a matrix sized n*n , where n is the number of vertices of the graph.

• POINTS
• SET
• PATH

The retrieval of items in a stack is ___________ operation.

• pop
• push
• access
• retrieval

Which of the following sorting algorithm is of priority queue sorting type?

• Merge sort
• Insertion sort
• Bubble sort
• Selection sort

Hashing provides a more reliable and_ method of data retrieval than any other data structure.

• STRECTHABLE
• FLEXIBLE
• CONCISE

A binary search tree is another name for a binary tree.

• True
• False

The following algorithm is a count-controlled loop going from 1 through 5. At each iteration, the loop counter is either printed or put on a queue depending on the result of Boolean function RanFun(). (The behavior of RanFun() is immaterial.) At the end of the loop, the items on the queue are dequeued and printed. Because of the logical properties of a queue, this algorithm cannot print certain sequences of the values of the loop counter. You are given an output and asked if the algorithm could generate the output. Set count to 0 WHILE (count < 5) Set count to count + 1 IF (RanFun()) Write count, ' ' ELSE Enqueue(myQueue, count) WHILE (NOT IsEmpty(myQueue)) Dequeue(myQueue, number) Write number, ' ' The following output is possible using a queue: 1 3 5 2 4

• True
• False

The four most common are probably line graphs, bar graphs and histograms, pie charts, and ?

• CARTESIAN
• LEAF
• POP

The hash table should be an array with length about __times the maximum number of keys that will actually be in the table, and. Size of hash table array should be a prime number.

• 1.5
• 1.3
• 1.2

A hash table is an array containing all of the keys to search on.

• YES
• NULL
• NONE

A _______________ is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.

• Neither of these
• Both of these

In linked representation of stack, the null pointer of the last node in the list signals _____________________.

• In between some value
• Beginning of the stack
• Bottom of the stack
• Middle of the stack

The term used to insert an element into stack.

• pump
• pop
• pull
• push

A connected graph T without any cycles is called a ____________.

• A tree
• all of these
• Free tree
• A tree graph

New nodes are added to the ________ of the queue.

• Front and Back
• Middle
• Front
• Back

Binary search trees are ordered.

• True
• False

In a 2-tree, nodes with 0 children are called ___________.

• outer node
• external node
• outside node
• exterior node

Which of the following is non-linear data structure?

• Trees
• Stacks
• Strings
• List

Algorithms that use a list must know whether the list is array based or linked.

• True
• False

LINK is the pointer pointing to the ____________________.

• successor node
• last node
• predecessor node

The following algorithm is a count-controlled loop going from 1 through 5. At each iteration, the loop counter is either printed or put on a queue depending on the result of Boolean function RanFun(). (The behavior of RanFun() is immaterial.) At the end of the loop, the items on the queue are dequeued and printed. Because of the logical properties of a queue, this algorithm cannot print certain sequences of the values of the loop counter. You are given an output and asked if the algorithm could generate the output. Set count to 0 WHILE (count < 5) Set count to count + 1 IF (RanFun()) Write count, ' ' ELSE Enqueue(myQueue, count) WHILE (NOT IsEmpty(myQueue)) Dequeue(myQueue, number) Write number, ' ' The following output is possible using a queue: 1 3 5 4 2

• True
• False

The complexity of sorting algorithm measures the __________ as a function of the number n of items to be shorter.

• case-complexity
• average time
• running time
• average-case complexity

Which of the following is not the part of ADT description?

• Operations
• Both of these
• Data
• None of these

_______ Algorithm : performs better in typical situations (sparse graphs) because it uses simpler data structures.

• FLLOYD
• PRIM'S
• KRUSKAL'S

____________________ level is where the model becomes compatible executable code.

• Application level
• All of these
• Abstract level
• Implementation level

Binary search algorithm cannot be applied to _______________.

• sorted binary trees
• sorted linear array
• pointer array

Graphs are a powerful and versatile data structure that easily allow you to represent real life relationships between different types of data (nodes).

• YES
• SELDOM
• NO

The elements are removal from a stack in _________ order.

• Sequential
• Reverse
• Alternative
• Hierarchical

A complete digraph is a directed graph in which every pair of distinct vertices is connected by a ___of unique edges (one in each direction).

• MULTIPLE
• PAIR
• SINGLE

Indicate which structure would be a more suitable choice for each of the following applications. A program keeping track of where canned goods are located on a shelf.

• Binary search tree
• Tree
• Stack
• Queue
• Graph

The value in the left child of a node (if it exists) in a binary search tree will be greater than the value in the node itself.

• True
• False

A program to receive data that is to be saved and processed in the reverse order.

• Binary search tree
• Queue
• Tree
• Stack
• Graph

Which of the following is not a limitation of binary search algorithm?

• requirement of sorted array is expensive when a lot of insertion and deletions are needed
• must use a sorted array
• there must be a mechanism to access middle element directly
• binary search algorithm is not efficient when the data elements more than 1500

Comparing BFS and DFS, the big advantage of DFS is that it has much _____memory requirements than BFS, because it's not necessary to store all of the child pointers at each level.

• LOWER
• NEUTRAL
• HIGHER

Graph Algorithms or Graph ______ are analytic tools used to determine strength and direction of relationships between objects in a graph.

• HASHING
• ANALYTICS
• GRAPH

In a graph, if E=(u,v), it means _____________.

• v is adjacent to u but u is not adjacent to v
• u is adjacent to v but v is not adjacent to u
• e begins at processor u and ends at successor v
• e begins at processor v and ends at successor u

A stack displays FIFO behavior.

• True
• False

A stack and a queue are different names for the same ADT.

• True
• False

Which of the following is not the required condition for binary search algorithm?

• Number values should only be present
• There must be mechanism to delete and/or insert elements in list
• The list must be sorted
• There should be the direct access to the middle element in any sub list.

A binary search tree whose left subtree and right subtree differ in height by at most 1 unit is called ____________________.

• Lemma tree
• Red-black tree
• None of these
• AVL tree

A hash function is a function which when given a key, generates an address in the table.

• TRUE
• BOTH A AND B
• FALSE

Partition and exchange sort is ____________.

• quick sort
• tree sort
• bubble sort
• heap sort

Linked lists are best suited _____________________.

• for none of these situations
• data structure
• for the size of the structure and the data in the structure are constantly changing
• for relatively permanent collections of data

A graph is a____structure that has two types of elements, vertices and edges.

• PATH
• DATA
• ALGORITHM

What is written by the following algorithm? Enqueue(myQueue, 5) Enqueue(myQueue, 4) Enqueue(myQueue, 4) Dequeue(myQueue, item) Dequeue(myQueue, item) Enqueue(myQueue, item) WHILE (NOT IsEmpty(myQueue)) Dequeue(myQueue, item) Write item, ' '

• 4 4

Stack is also called the ________________.

• First in, first out
• Last in, first out
• Last in, last out
• First in, last out

The complexity of linear search algorithm.

• O(logn)
• ONo
• O(n2)
• O(n logn)

Dijkstra's algorithm is Dijkstra's algorithm, it is neither algorithm because BFS and DFS themselves are not Dijkstra's algorithm.

• TRUE
• FALSE
• BOTH A AND B

The average case occurs in linear search algorithm _______________.

• when item is the last element in the array
• item is the last element in the array or item is not there at all
• when item is somewhere in the middle of the array
• when item is not the array at all

What is written by the following algorithm? Push(myStack, 5) Push(myStack, 4) Push(myStack, 4) Pop(myStack, item) Pop(myStack, item) Push(myStack, item) WHILE (NOT IsEmpty(myStack)) Pop(myStack, item) Write item, ' '

• 4 5

The situation when in a linked list START=NULL is ____________________.

• Houseful
• Underflow
• Saturated
• Overflow

In a linked list, the ____________ contains the address of next element in the list.

• Start field
• Next element field
• Info field

Each node in a linked list must contain at least ___________________.

• Three fields
• Four fields
• Two fields
• Five fields

Every node N in a binary tree T except the root has a unique parent called the ________ of N.

• Predecessor
• Precursor
• Forerunner
• Antecedents

The Floyd-Warshall algorithm outputs the correct result as long as no negative cycles exist in the input graph.

• POINTS
• FALSE
• TRUE

A binary tree is a tree in which each node can have zero, one, or two children.

• True
• False

This may take place only when there is some minimum amount or no space left in free storage list.

• Maintenance
• Garbage collection
• Recycle bin
• Memory management

The Three methods in HASHING in open addressing are linear probing, quadratic probing, and _____hashing.

• DOUBLE
• SINGLE
• MULTI

Tree is a hierarchical data structure which stores the information naturally in the form of hierarchy style.

• NONE OF THE ABOVE
• FALSE
• TRUE

______ is one of the most powerful and advanced data structures. It is a non-linear data structure compared to arrays, linked lists, stack and queue. It represents the nodes connected by edges.

• SET
• LOOP
• TREE

The eight most commonly used graphs are linear, power, quadratic, polynomial, rational, ______, logarithmic, and sinusoidal.

• NULL
• EXPONENTIAL
• DYNAMIC

State True or False for internal sorting algorithms. i. Internal sorting are applied when the entire collection if data to be sorted is small enough that the sorting can take place within main memory. ii. The time required to read or write is considered significant in evaluating the performance of internal sorting.

• True, False
• False, True
• True, True
• False, False

A simple graph, also called a ______graph.

• DIJKSTRA
• SHORTEST
• STRICT

The depth of complete binary tree is given by ________________.

• Dn = n log2n+1
• Dn = log2n+1
• Dn = log2n
• Dn = n log2n

Shortest path algorithms are a family of algorithms designed to solve the shortest path problem.

• YES
• NO
• USUALLY

It is a pile in which items are added at one end and removed from the other.

• none of these
• queue
• list
• stack

______ are a common method to visually illustrate relationships in the data.

• HASHABLE
• HASH
• GRAPHS

Which of the following sorting algorithm is of the divide and conquer type?

• Insertion sort
• Bubble sort
• Selection sort
• Merge sort

• middle record of the actual data
• first record of the actual data
• last record of the actual data
• pointer to the last record of the actual data

A dictionary of words used by a spelling checker to be built and maintained.

• Binary search tree
• Stack
• Graph
• Tree
• Queue

Breadth-first-search is the algorithm that will find shortest paths in an _____ graph.

• UNWEIGHTED
• FULL
• WEIGHTED

In computer science, a problem is said to have optimal substructure if an optimal solution can be constructed from optimal solutions of its subproblems.

• FALSE
• NO
• TRUE

The rearranging of pairs of elements which are out of order, until no such pairs remain.

• Selection
• Distribution
• Insertion
• Exchange

A pseudo _____-graph is a general-graph allowing edges to connect a vertex to itself.

• GENERAL
• BUG
• SLOW

This is a linear list in which insertions and deletions are made to form either end of the structure.

• Circular queue
• Dequeue
• Random of queue
• Priority