Suppose you are given a binary tree with n nodes, such that each node has exactly either zero or two children. The maximum height of the tree will be (A) n/2 - 1 (B) n/2 + 1 (C) (n-1)/2 (D) (n+1)/2

1 Answer

Answer :

(C) (n-1)/2

Related questions

Description : Consider an implementation of unsorted single linked list. Suppose it has its representation with a head and a tail pointer (i.e. pointers to the first and last nodes of the linked list). Given the ... the front node of the linked list. (D) Deletion of the last node of the linked list.

Last Answer : (D) Deletion of the last node of the linked list. 

Description : Suppose that we have numbers between 1 and 1000 in a binary search tree and want to search for the number 364. Which of the following sequences could not be the sequence of nodes examined? (A) 925, 221, 912, 245, 899, ... 926, 203, 912, 241, 913, 246, 364 (D) 3, 253, 402, 399, 331, 345, 398, 364 

Last Answer : (C) 926, 203, 912, 241, 913, 246, 364

Description : The order of a leaf node in a B+ tree is the maximum number of children it can have. Suppose that block size is 1 kilobytes, the child pointer takes 7 bytes long and search field value takes 14 bytes long. The order of the leaf node is ............ (1) 16 (2) 63 (3) 64 (4) 65

Last Answer : Answer: All

Description : Consider the following game tree in which root is a maximizing node and children are visited left to right. What nodes will be pruned by the alphabeta pruning?  (A) I (B) HI (C) CHI (D) GHI

Last Answer : (B) HI

Description : State true or false. i) An empty tree is also a binary tree. ii) In strictly binary tree, the outdegree of every node is either o or 2. A) True, False B) False, True C) True, True D) False, False

Last Answer : C) True, True

Description : A full binary tree with n leaves contains (A) n nodes (B) log2 n nodes (C) 2n –1 nodes (D) 2n nodes

Last Answer : (C) 2n –1 nodes 

Description : The runtime for traversing all the nodes of a binary search tree with n nodes and printing them in an order is (A) O(lg n) (B) O(n lg n) (C) O(n) (D) O(n2 ) 

Last Answer : (C) O(n) 

Description : State true or false. i) The degree of root node is always zero. ii) Nodes that are not root and not leaf are called as internal nodes. A) True, True B) True, False C) False, True D) False, False

Last Answer : C) False, True

Description : A …………… is an acyclic digraph, which has only one node with indegree 0, and other nodes have indegree 1. A) Directed tree B) Undirected tree C) Dis-joint tree D) Direction oriented tree

Last Answer : A) Directed tree

Description : ………………. Is a directed tree in which outdegree of each node is less than or equal to two. A) Unary tree B) Binary tree C) Dinary tree D) Both B and C

Last Answer : B) Binary tree

Description : Which of the following arguments are not valid? (a) If Gora gets the job and works hard, then he will be promoted. If Gora gets promotion, then he will be happy. He will not be happy, therefore, either he will not get the job or he ... and (c) (B) (b) and (c) (C) (a), (b) and (c) (D) (a) and (b)

Last Answer : Answer: B Explanation: (a) P: Gora gets the job  Q: Gora works hard  R: Gora gets promotion  S: Gora will be happy The argument can bet written as  (P˄Q)→R  R→S  ¬S ... also be written as: ((P˅Q)˄¬P)→Q where P, and Q are propositions expressed in some formal system.

Description : Which of the following information about the UNIX file system is not correct? (A) Super block contains the number of i-nodes, the number of disk blocks, and the start of the list of free disk blocks. (B ... Each i-node is 256-bytes long. (D) All the files and directories are stored in data blocks. 

Last Answer : (C) Each i-node is 256-bytes long.

Description : Consider the following statements: (a) Depth - first search is used to traverse a rooted tree. (b) Pre - order, Post-order and Inorder are used to list the vertices of an ordered rooted tree. (c) Huffman's algorithm is used to find an optimal ... (d) (C) (a) , (b) and (c) (D) (a), (b) , (c) and (d)

Last Answer : (D) (a), (b) , (c) and (d)

Description : Consider the following binary search tree: If we remove the root node, which of the node from the left subtree will be the new root? (A) 11 (B) 12 (C) 13 (D) 16

Last Answer : (D) 16

Description : A graph is a collection of nodes, called ………. And line segments called arcs or ……….. that connect pair of nodes. A) vertices, edges B) edges, vertices C) vertices, paths D) graph node, edges

Last Answer : A) vertices, edges

Description : State true of false. i) A node is a parent if it has successor nodes. ii) A node is child node if out degree is one. A) True, True B) True, False C) False, True D) False, False

Last Answer : B) True, False

Description : For a B-tree of height h and degree t, the total CPU time used to insert a node is (A) O(h log t) (B) O(t log h) (C) O(t2h) (D) O(th)

Last Answer : (D) O(th)

Description : The number of different binary trees with 6 nodes is ............. (A) 6 (B) 42 (C) 132 (D) 256

Last Answer : (C) 132

Description : Suppose there are n stations in a slotted LAN. Each station attempts to transmit with a probability P in each time slot. The probability that only one station transmits in a given slot is .................. (1) nP(1-P)n-1 (2) nP (3) P(1-P)n-1 (4) nP(1-P)n-1

Last Answer :  nP(1-P)n-1

Description : Suppose there are four processes in execution with 12 instances of a Resource R in a system. The maximum need of each process and current allocation are given below: With reference to current allocation, is system safe? If so, ... B) Yes, P1 P2 P3 P4 (C) Yes, P4 P3 P1 P2 (D) Yes, P2 P1 P3 P4

Last Answer : (C) Yes, P4 P3 P1 P2

Description : A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is  A) log2n B) n-1 C) n D) 2n

Last Answer : A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is n-1

Description : A unix file system has 1-KB blocks and 4-byte disk addresses. What is the maximum file size if i-nodes contain 10 direct entries and one single, double and triple indirect entry each? (A) 32 GB (B) 64 GB (C) 16 GB (D) 1 GB

Last Answer : (C) 16 GB

Description : What is the name of the network topology in which there are bi-directional links between each possible node? A) Ring B) Star C) Tree D) Mesh

Last Answer : D) Mesh

Description : Which one of the following is used to compute cyclomatic complexity ? (A) The number of regions - 1 (B) E - N + 1, where E is the number of flow graph edges and N is the number of flow graph nodes. (C) ... in the flow graph G. (D) P + 1, where P is the number of predicate nodes in the flow graph G.

Last Answer : (D) P + 1, where P is the number of predicate nodes in the flow graph G.

Description : The number of distinct binary images which can be generated from a given binary image of right M × N are (A) M + N (B) M × N (C) 2M + N (D) 2MN

Last Answer : (D) 2MN

Description : A heuristic is a way of trying ___________ a) To discover something or an idea embedded in a program b) To search and measure how far a node in a search tree seems to be from a goal c) To compare two nodes in a search tree to see if one is better than another d) All of the mentioned

Last Answer : d) All of the mentioned

Description : A heuristic is a way of trying __________ a) To discover something or an idea embedded in a program b) To search and measure how far a node in a search tree seems to be from a goal c) To compare two nodes in a search tree to see if one is better than the other is d) All of the mentioned

Last Answer : d) All of the mentioned

Description : A heuristic is a way of trying (A) To discover something or an idea embedded in a program (B) To search and measure how far a node in a search tree seems to be from a goal (C) To compare two nodes in a search tree to see if one is better than the other (D) Only (a), (b) and (c).

Last Answer : (D) Only (a), (b) and (c).

Description : For the implementation of a paging scheme, suppose the average process size be x bytes, the page size be y bytes, and each page entry requires z bytes. The optimum page size that minimizes the total overhead due to the page ... fragmentation loss is given by (A) x/2 (B) xz/2 (C) √2xz (D) (√xz)/2

Last Answer : (C) √2xz 

Description : Which of the following statements is false? (A) Optimal binary search tree construction can be performed efficiently using dynamic programming. (B) Breadth-first search cannot be used to find connected components of a graph. (C) ... used to find the components of a graph. (1) A (2) B (3) C (4) D 

Last Answer : Answer: 2

Description : If h* represents an estimate of the cost of getting from the current node N to the goal node and h represents actual cost of getting from current node to the goal node, then A* algorithm gives an optimal solution ... h* us equal to h (B) h* overestimates h (C) h* underestimates h (D) none of these

Last Answer : (C) h* underestimates h

Description : Consider f(N) = g(N) + h(N) Where function g is a measure of the cost of getting from the start node to the current node N and h is an estimate of additional cost of getting from the current ... ? (A) A* algorithm (B) AO* algorithm (C) Greedy best first search algorithm (D) Iterative A* algorithm

Last Answer : (C) Greedy best first search algorithm

Description : The number of disk pages access in B-tree search, where h is height, n is the number of keys, and t is the minimum degree, is: (A) θ(logn h*t) (B) θ(logt n*h) (C) θ(logh n) (D) θ(logt n)

Last Answer : Answer: D

Description : Any decision tree that sorts n elements has height .............. (1) Ω(log n) (2) Ω(n) (3) Ω(n log n) (4) Ω(n2)

Last Answer : (3) Ω(n log n) 

Description : Which of the following provides the best description of an entity type? (A) A specific concrete object with a defined set of processes (e.g. Jatin with diabetes) (B) A value given to a ... template for a group of things with the same set of characteristics that may exist in the real world

Last Answer : Answer: D

Description : For any B-tree of minimum degree t ≥2, every node other than the root must have atleast ............... keys and every node can have at most .............. keys. (A) t-1, 2t+1 (B) t+1, 2t+1 (C) t-1, 2t-1 (D) t+1, 2t-1

Last Answer : (C) t-1, 2t-1 

Description : Which is true for neural networks? a) It has set of nodes and connections b) Each node computes it’s weighted input c) Node could be in excited state or non-excited state d) All of the mentioned

Last Answer : d) All of the mentioned

Description : Basic idea of an partitioned nets is to break network into spaces which consist of groups of nodes and arcs and regard each space as a node. a) True b) False

Last Answer : a) True

Description : Which is true for neural networks? a) It has set of nodes and connections b) Each node computes it’s weighted input c) Node could be in excited state or non-excited state d) All of the mentioned

Last Answer : d) All of the mentioned

Description : Given a flow graph with 10 nodes, 13 edges and one connected components, the number of regions and the number of predicate (decision) nodes in the flow graph will be (A) 4, 5 (B) 5, 4 (C) 3, 1 (D) 13, 8

Last Answer : (B) 5, 4

Description : A node X on a 10 Mbps network is regulated by a token bucket. The token bucket is filled at a rate of 2 Mbps. Token bucket is initially filled with 16 megabits. The maximum duration taken by X to transmit at full rate of 10 Mbps is ............ secs. (1) 1 (2) 2 (3) 3 (4) 4

Last Answer : (2) 2 

Description : Consider a system with twelve magnetic tape drives and three processes P1, P2 and P3. Process P1 requires maximum ten tape drives, process P2 may need as many as four tape drives and P3 may need upto nine ... , system is in: (A) safe state (B) unsafe state (C) deadlocked state (D) starvation state

Last Answer : Answer: B

Description : A tree with n vertices is called graceful, if its vertices can be labelled with integers 1, 2, ...,n such that the absolute value of the difference of the labels of adjacent vertices are all different. Which of the following trees are ... (B) (b) and (c) (C) (a) and (c) (D) (a), (b) and (c)

Last Answer : Answer: D

Description : State True or False. i) While overloading operators new operator can be overloaded. ii) The binary operator such as +, -, * and must explicitly return a value. A) True, True B) True, False C) False, True D) False, False

Last Answer : C) False, True

Description : Suppose a digitized voice channel is made by digitizing 8 kHz bandwidth analog voice signal. It is required to sample the signal at twice the highest frequency (two samples per hertz). What is the bit rate required, if it ... sample requires 8 bits? (A) 32 kbps (B) 64 kbps (C) 128 kbps (D) 256 kbps

Last Answer : (C) 128 kbps

Description : Suppose ORACLE relation R(A, B) currently has tuples {(1, 2), (1, 3), (3, 4)} and relation S(B, C) currently has {(2, 5), (4, 6), (7, 8)}. Consider the following two SQL queries SQ1 and SQ2 ... (A) 2 and 6 respectively (B) 6 and 2 respectively (C) 2 and 4 respectively (D) 4 and 2 respectively

Last Answer : (D) 4 and 2 respectively

Description : For like predicate which of the following is true. i) % matches zero of more characters. ii) _ matches exactly one character. A) i-only B) ii-only C) Both of them D) None of them

Last Answer : C) Both of them

Description : Suppose the function y and a fuzzy integer number around -4 for x are given as y=(x-3)2+2 Around -4={(2,0.3), (3,0.6), (4,1), (5,0.6), (6,0.3)} respectively. Then f(Around - 4) is given by: (A) {(2,0.6), (3,0.3), ... 6), (3,1), (6,0.6), (11,0.3)} (D) {(2,0.6), (3,0.3), (6,0.6), (11,0.3)}

Last Answer : (C) {(2,0.6), (3,1), (6,0.6), (11,0.3)}