Let $P$ be the set of all integers from 1 to 15 . Consider any order of insertion of the elements of $P$ into a binary search tree that creates a complete binary tree. Which one of the following elements can NEVER be the third element that is inserted?
Consider the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph $G(V, E)$ as input, where $d[v]$ and $f[v]$ are the discovery time and finishing time, respectively, of the vertex $v \in V$.
|
DFS(G): unmark all v ∈ V t ← 0 for each v ∈ V if v is unmarked t ← Explore(G, v, t) end if end for |
Explore(G, v, t): mark v t ← t + 1 d[v] ← t for each (v, w) ∈ E if w is unmarked t ← Explore(G, w, t) end if end for t ← t + 1 f[v] ← t return t |
Suppose that the input directed graph $G(V, E)$ is a directed acyclic graph (DAG). For an edge $(u, v) \in E$, which of the following options will NEVER be correct?
An undirected, unweighted, simple graph $G(V, E)$ is said to be 2 -colorable if there exists a function $c: V \rightarrow\{0,1\}$ such that for every $(u, v) \in E, c(u) \neq c(v)$.
Which of the following statements about 2-colorable graphs is/are true?
The following sequence corresponds to the preorder traversal of a binary search tree:
$$ 50,25,13,40,30,47,75,60,70,80,77 $$
The position of the element 60 in the postorder traversal of $T$ is $\_\_\_\_$ . (answer in integer)
Note: The position begins with 1.
GATE CSE Papers
All year-wise previous year question papers