• recategorized by
16,155 views
50 50 votes

Which of the following statements is false?

  1. Optimal binary search tree construction can be performed efficiently using dynamic programming

  2. Breadth-first search cannot be used to find connected components of a graph

  3. Given the prefix and postfix walks over a binary tree, the binary tree cannot be uniquely constructed.

  4. Depth-first search can be used to find connected components of a graph

7 Answers

Best answer
32 32 votes

The answer is B.

  1. True.
  2. False.
  3. True.
  4. True.
• edited by
37 37 votes

$A.$ An optimal binary search tree is a binary search tree for which the nodes are arranged on levels such that the tree cost is minimum and it can be performed efficiently using Dynamic programming.click here

                          when $j\geq i $ $\bigg\{E = E[i,r-1] + E[r+1,j] + W(i,j)\bigg\} $

                            when $j\geq i $ $\Big\{W(i,j) = \Sigma^j_{l=i} p_l + \Sigma^l_{l=i-1} q_l \Big\}$

$B.$ To find Connected components we can start with either BFS or DFS but DFS is preffered over BFS because BFS takes exponential amount of memory whereas DFS takes linear amount of memory

$C.$ Using prefix and postfix the binary tree cannot be uniquely constructed check here

$D.$ It can be used and it consumes linear amount of memory 

So $B$ is right answer

• edited by
9 9 votes
Answer B, We can randomly select a source vertex and run BFS algorithm, after that we need to check each vertex whether it's distance from source is still infinite or not(note: BFS algorithm first initializes each vertex's distance  from source as infinite and source's distance as 0) . If we find any vertex  having infinite distance then the graph is not connected(Assuming the graph is undirected)
2 2 votes
well go through every option and lets see which option is false

option a)Dynamic programming minimizes the search cost by calculating the weighted search cost for all subtrees.this makes option a is true.

option b)By BFS (or even DFS) on all unvisited nodes in an undirected graph,we can identify the connected components.so this option is false.

option c)here we need to be careful because as far as i know we can construct binary search tree with prefix and postfix but we cant construct binary tree with only prefix and postfix for this construction we need infix and with the combination of prefix or postfix.heyy..i mean i am talking in terms of order but context same so no worries.So,yeah asking binary tree and not binary search tree so this option is true.

option d)same as option b with dfs also we can find our connected components of a graph.so this option also true

so finally option b is false

I hope this helps !!🙂

 
Answer:
Position:
Show:

Related questions

1 1 vote
1 answers 1 answer
2.6k
2.6k views
Kathleen asked Oct 5, 2014
2,638 views
Consider the program below:Program main: var r:integer; procedure two: begin write (r); end procedure one: var r:integer; begin r:=5; two; end begin r:=2; two; one; two; ...
72 72 votes
8 answers 8 answers
26.6k
26.6k views
Kathleen asked Oct 4, 2014
26,558 views
Consider the following two functions:$g_1(n) = \begin{cases} n^3 \text{ for } 0 \leq n \leq 10,000 \\ n^2 \text{ for } n 10,000 \end{cases}$$g_2(n) = \begin{cases} n \te...
18 18 votes
2 answers 2 answers
8.0k
8.0k views
Kathleen asked Oct 5, 2014
7,957 views
An array $A$ contains $n$ integers in locations $A[0], A , \dots A[n-1]$. It is required to shift the elements of the array cyclically to the left by $K$ places, where $1...
21 21 votes
4 answers 4 answers
5.5k
5.5k views
Kathleen asked Oct 5, 2014
5,528 views
What function of $x$, $n$ is computed by this program?Function what(x, n:integer): integer: Var value : integer begin value := 1 if n 0 then begin if n mod 2 =1 then val...