Вы находитесь на странице: 1из 5

Jntuk online bits of Data Structures

for

ECE & CSE & IT

Q)A full binary tree with n non-leaf nodes contains _______________ nodes.--> 2n+1
Q)Traversing a binary tree first left, then root and then right subtree is called ____________
traversal--> In-order
Q)The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal-->
ABDECF
Q)The out degree of a binary trees leaf node is--> 0
Q)What is the minimum number of nodes in a full binary tree with depth 3?--> 15
Q)Select the one FALSE statement about binary trees--> Every binary tree has at least one
node.
Q)The top node in a tree hierarchy is called as ____________ node.--> root
Q)Binary Trees are best suited for implementing--> Decision Trees having YES/NO at each level
Q)A tree having a main node, which doesnt have any parents is called--> Rooted tree
Q)In a tree, between every pair of vertices there is--> Exactly one path
Q)Which of the following is a not non-linear data structure?--> Queue
Q)Number of possible binary trees with 3 unlabeled nodes is--> 5
Q)A _________ is a data structure consisting of nodes organized as hierarchy.--> Tree
Q)Which of the following ways below is the In-Order traversal?--> Left Sub Tree Root Right Sub
Tree
Q)A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is--> n-1
Q)A tree node with zero children is called as a ___________ node.--> leaf

Q)How many nodes in the tree below have at least one sibling?
--> 6
Q)What is the minimum number of nodes in a complete binary tree with depth 3?--> 8
Q)Which expression indicates that node t represents a leaf node?--> ((t->left == NULL) && (t>right == NULL))
Q)A 3-ary tree in which every internal node has exactly 3 children. The number of leaf nodes in
such a tree with 6 internal nodes will be--> 13
Q)Find the odd man out--> Queue
Q)_____________ is a directed tree in which out degree of each node is less than or equal to
two.--> Binary tree
Q)Which of the following ways below is the Pre-Order traversal?--> Root Left Sub Tree Right
Sub Tree
Q)A binary tree in which if all its levels except possibly the last, have the maximum number of
nodes and all the nodes at the last level appear as far as possible, is known as--> Complete
binary tree
Q)How many nodes in a tree have no parents?--> 0
Q)Select the one true statement.--> Every full binary tree is also a complete binary tree.
Q)In strictly binary tree, the out degree of every node is--> 0 or 2
Q)Which of the following ways below is the Post-Order traversal?--> Left Sub Tree Right Sub
Tree Root
Q)Traversing a binary tree first left, then right and then root is called ____________ traversal-->

Post-order
Q)A binary tree stored using linked representation can be converted to its mirror image by
traversing it in--> Pre order
Q)To represent hierarchical relationship between elements, which data structure is suitable?-->
Tree
Q)The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal-->
ABDECF
Q)Maximum number of nodes in a binary tree of depth K--> 2k-1
Q)The in-degree of a binary trees root node is--> 0
Q)Suppose T is a binary tree with 14 nodes. What is the minimum possible depth of T?--> 3
Q)Consider the node of a complete binary tree whose value is stored in data[i] for an array
implementation. If this node has a right child, where will the right child 's value be stored?-->
data[2i+2]
Q)Traversing a binary tree first root, then left and then right subtree is called ____________
traversal--> Pre-order
Q)In a tree, if a node is child, its in degree is--> 1
Q)The number of unused pointers in a full binary tree of depth 5 is--> 16
Q)A full binary tree with n leaf nodes contains _______________ nodes.--> 2n-1
Q)Which of the following is NOT a valid number of children a binary tree node can have?--> 3

Q)Which statement is true about the tree below?


--> The tree is neither
complete nor full
Q)One can determine whether a Binary tree is a Binary Search Tree by traversing it in--> In
order
Q)The in-order traversal of tree will yield a sorted listing of elements of tree in--> Binary Search
Trees
Q)If there is an imbalance in AVL tree caused because of a node inserted in right childs left subtree of the imbalanced node, the rotation to be applied is _________--> RL rotation
Q)If imbalance occurred at an AVL tree node, because of deleting a node from its right sub-tree
and its left childs balance factor is 1, then the rotation to be applied is--> R1 rotation
Q)An AVL Tree is constructed by inserting the elements in the following order 5,4,2,3,7,6 the
elements which are in the leaf node are--> 5,3,7
Q)Identify the FALSE statement--> AVL tree is a not a Binary Search Tree
Q)The maximum number of nodes in a binary tree of depth 5 is--> 31
Q)When in-order traversing a tree resulted E A C K F H D B G; the preorder traversal would
return--> FAEKCDHGB
Q)The following insertions are made to an initially empty AVL Tree : 3,2,1,4,7,5,6 then the root
of the right subtree of the AVL Tree is--> 6
Q)The balance factor of a node A was 0 and a node was inserted to the left of the node A then-> Balancing may or may not be required for A

Q)In ______, the difference between the height of the left sub tree and height of the right sub
tree tree, for each node, is almost one.--> AVL - tree
Q)There are ____ types of possible rotations in an AVL tree, if the tree got imbalanced after
deletion--> 6
Q)The time required to search an element in a balanced binary search tree having n elements
is--> O(log n)
Q)The worst case running time to search for an element in a balanced in a binary search tree
with n*2^n elements is--> O(n)
Q)The time required to search an element in an AVL tree having n elements is--> O(log n)
Q)In an AVL tree to delete a parent with two Childs in a straight line _______ rotations will be
required--> Double
Q)Which of the following is not a valid balance factor of an AVL tree node?--> 2
Q)A tree is an AVL tree if--> All the nodes are balanced
Q)If there is an imbalance in AVL tree caused because of a node inserted in left childs right subtree of the imbalanced node, the rotation to be applied is _________--> LR rotation
Q)If imbalance occurred at an AVL tree node, because of deleting a node from its right sub-tree
and its left childs balance factor is 0, then the rotation to be applied is--> R0 rotation
Q)The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42.
Which one of the following is the postorder traversal sequence of the same tree?--> 15, 10, 23,
25, 20, 35, 42, 39,30
Q)AVL Tree is--> Non Linear data structure
Q)The depth of an AVL tree with n elements is--> 1.44 log n
Q)In ______, the difference between the height of the left sub tree and height of the right tree,
for each node, is almost one--> AVL tree
Q)If imbalance occurred at an AVL tree node, because of deleting a node from its left sub-tree
and its right childs balance factor is -1, then the rotation to be applied is--> L-1 rotation
Q)If imbalance occurred at an AVL tree node, because of deleting a node from its right sub-tree
and its left childs balance factor is -1, then the rotation to be applied is--> R-1 rotation
Q)The AVL tree insertion rotations that involves single rotations are--> LL and RR
Q)If there is an imbalance in AVL tree caused because of a node inserted in right childs right
sub-tree of the imbalanced node, the rotation to be applied is _________--> RR rotation
Q)What is the maximum height of any AVL-tree with 7 nodes? Assume that the height of a tree
with a single node is 0.--> 3
Q)Suppose the numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty
binary search tree. The binary search tree uses the usual ordering on natural numbers. What is
the in-order traversal sequence of the resultant tree?--> 0 1 2 3 4 5 6 7 8 9
Q)If imbalance occurred at an AVL tree node, because of deleting a node from its left sub-tree
and its right childs balance factor is 1, then the rotation to be applied is--> L1 rotation
Q)To list the elements in ascending order, a Binary Search Tree must be traversed in--> In-order
Q)Worst case search performance of a Binary Search Tree for which of the below cases--> Every
node is having only left subtree
Q)Which of the following algorithm computes transitive closure of a graph?--> Warshalls
algorithm
Q)The AVL tree insertion rotations that involves double rotations are--> RL and LR

Q)The worst case performance of the search for a key in a BALANCED Binary Search Tree is-->
O(log n)
Q)If there is an imbalance in AVL tree caused because of a node inserted in left childs left subtree of the imbalanced node, the rotation to be applied is _________--> LL rotation
Q)In AVL Tree, the Balance Factor is calculated as--> Left Height Right Height
Q)If each node in a tree has a value greater than every value in its left sub tree and has value
less than every value in its right sub tree, the binary tree is known as--> Binary search tree
Q)Which of the following statement is FALSE?--> Every tree has a cycle
Q)AVL trees have a faster ________________--> Retrieval
Q)If imbalance occurred at an AVL tree node, because of deleting a node from its left sub-tree
and its right childs balance factor is 0, then the rotation to be applied is--> L0 rotation
Q)How many distinct binary search trees can be created out of 4 distinct keys?--> 14
Q)The following numbers are inserted into an empty binary search tree in the given order: 10,
1, 3, 5, 15, 12, 16. What is the height of the binary search tree?--> 3
Q)There are ___________ types of graph traversals--> 2
Q)Which of the following is not an element of graphs?--> Root
Q)A graph with no edges is called _____________--> Empty Graph
Q)Suppose you have a directed graph representing all the flights that an airline flies. What
algorithm might be used to find the best sequence of connections from one city to another?-->
A shortest-path algorithm.
Q)Which graph representation allows the most efficient determination of the existence of a
particular edge in a graph?--> Edge List
Q)A graph is a collection of _____________--> Vertices and Edges
Q)The degree if a vertex is--> Number of edges incedent to a vertex
Q)What is generally true of Adjacency List and Adjacency Matrix representations of graphs?-->
Lists require less space than matrices but take longer to find the weight of an edge (v1,v2)
Q)Warshalls algorithm uses ____________ property of paths & connectivity.--> Transitivity
Q)Size of the adjacency matrix for a graph with n vertices and m edges is--> n x n
Q)Which of the following statements is true?--> A graph must have at least one vertex.
Q)If G is a directed graph with 20 vertices, how many boolean values will be needed to
represent G using an adjacency matrix?--> 400
Q)If every node u in G is adjacent to every other node v in G, A graph is said to be--> complete
Q)What graph traversal algorithm uses a queue to keep track of vertices which need to be
processed?--> BFS
Q)An undirected graph which contains no cycles is called--> Forest
Q)The length of a path in an unweighted graph is--> Number of edges in that path
Q)A graph that does not have any cycles is called--> Acyclic graph
Q)In a simple graph the diagonal entries of its adjacency matrix are--> 0
Q)Which of the following is not a representation of graphs?--> Eigen Vector
Q)In order to construct a minimum cost spanning tree using Kruskals Algorithm, you should
begin by___________________.--> selecting the lowest cost edge
Q)A graph is said to be complete if there is an edge between--> every pair of vertices
Q)If there is an edge from vertex I to vertex J, the J is said to be _________ to I.--> Adjacent
Q)Minimum no. of edges in a connected cyclic graph on N vertices is--> N-1

Q)If the origin and terminus of a path are same it is known as ____________--> Cycle
Q)The indegree of a vertex in a digraph is--> Number of edges directed towards that vertex
Q)The outdegree of a vertex in a digraph is--> Number of edges directed away from that vertex
Q)A connected acyclic graph is also known as--> Tree
Q)A digraph is strongly connected under what condition?--> If for every pair of vertices u & v,
such that u can reach v and vice versa
Q)A graph is said to be ________________ if the vertices can be split into two sets V1 and V2
such there are no edges between two vertices of V1 or two vertices of V2.--> Bipartite
Q)A connected graph without any cycles is called--> free tree
Q)What graph traversal algorithm uses a stack to keep track of vertices which need to be
processed?--> DFS
Q)Maximum degree of a vertex in a simple graph with N vertices is--> N
Q)What is the expected number of operations needed to loop through all the edges terminating
at a particular vertex given an adjacency matrix representation of the graph? (Assume n
vertices are in the graph and m edges terminate at the desired node.)--> O(n)
Q)An undirected graph G has n nodes. Its adjacency matrix is given by an n n square matrix
whose (i) all diagonal elements are 0s and (ii) all non-diagonal elements are 1s. which one of
the following is TRUE?--> The graph is complete
Q)A simple graph has no loops. What other property must a simple graph have?--> It must have
no multiple edges.
Q)If all edges of a graph are labeled with some numbers, the graph is called--> Weighted graph
Q)An edge in a graph is represented with--> Line
Q)In order to construct a minimum cost spanning tree using Prims Algorithm, you should begin
by___________________.--> selecting a vertex
Q)________________ is a graph that has weights or costs associated with it.--> network
Q)A directed graph is ____________, if there is a path from each vertex to every other vertex in
the digraph.--> Strongly Connected
Q)In the ______________ traversal we process all of a vertexs descendents before we move to
an adjacent vertex.--> Depth First
Q)A vertex in a graph is generally represented with--> Circle
Q)Which of the following is a non-linear data structure?--> Graph
Q)A graph in which the degree of all vertices is equal is called--> Regular Graph
Q)For plotting their flight paths, airlines use ____________ data structure--> Graph

Вам также может понравиться