Advanced Algorithm (Eldan) 2 (11) Dan

Descripción

Test sobre Advanced Algorithm (Eldan) 2 (11) Dan, creado por Alex Q el 24/12/2017.
Alex Q
Test por Alex Q, actualizado hace más de 1 año
Alex Q
Creado por Alex Q hace más de 6 años
50
2

Resumen del Recurso

Pregunta 1

Pregunta
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal, respectively, of a complete binary tree. Which of the following is always true?
Respuesta
  • LASTIN = LASTPOST
  • LASTIN = LASTPRE
  • LASTPRE = LASTPOST
  • None of the above

Pregunta 2

Pregunta
Which one of the following binary trees has its inorder and preorder traversals as BCAD and ABCD, respectively?
Respuesta
  • A
  • B
  • C
  • D

Pregunta 3

Pregunta
The numbers 1, 2, .... n are inserted in a binary search tree in some order. In the resulting tree, the right subtree of the root contains p nodes. The first number to be inserted in the tree must be
Respuesta
  • p
  • p + 1
  • n - p
  • n - p + 1

Pregunta 4

Pregunta
A binary search tree contains the numbers 1, 2, 3, 4, 5, 6, 7, 8. When the tree is traversed in pre-order and the values in each node printed out, the sequence of values obtained is 5, 3, 1, 2, 4, 6, 8, 7. If the tree is traversed in post-order, the sequence obtained would be
Respuesta
  • 8, 7, 6, 5, 4, 3, 2, 1
  • 1, 2, 3, 4, 8, 7, 6, 5
  • 2, 1, 4, 3, 6, 7, 8, 5
  • 2, 1, 4, 3, 7, 8, 6, 5

Pregunta 5

Pregunta
If all the edge weights of an undirected graph are positive, then any subset of edges that connects all the vertices and has minimum total weight is a
Respuesta
  • Hamiltonian cycle
  • grid
  • hypercube
  • tree

Pregunta 6

Pregunta
When searching for the key value 60 in a binary search tree, nodes containing the key values 10, 20, 40, 50, 70 80, 90 are traversed, not necessarily in the order given. How many different orders are possible in which these key values can occur on the search path from the root to the node containing the value 60?
Respuesta
  • 35
  • 64
  • 5040
  • 128

Pregunta 7

Pregunta
The following three are known to be the preorder, inorder and postorder sequences of a binary tree. But it is not known which is which. MBCAFHPYK KAMCBYPFH MABCKYFPH Pick the true statement from the following.
Respuesta
  • I and II are preorder and inorder sequences, respectively
  • I and III are preorder and postorder sequences, respectively
  • II is the inorder sequence, but nothing more can be said about the other two sequences
  • II and III are the preorder and inorder sequences, respectively

Pregunta 8

Pregunta
Consider the following sequence of nodes for the undirected graph given below. a b e f d g c a b e f c g d a d g e b c f a d b c g e f A Depth First Search (DFS) is started at node a. The nodes are listed in the order they are first visited. Which all of the above is (are) possible output(s)?
Respuesta
  • 1 and 3 only
  • 2 and 3 only
  • 2, 3 and 4 only
  • 1, 2, and 3

Pregunta 9

Pregunta
Which of the following statement is false?
Respuesta
  • A tree with n nodes has (n-1) edges.
  • A labeled rooted binary tree can be uniquely constructed given its postorder and preorder traversal results.
  • A complete binary tree with n internal nodes has (n+1) leaves.
  • The maximum number of nodes in a binary tree of height h is (2^(k+1) -1)

Pregunta 10

Pregunta
A complete n-ary tree is one in which every node has 0 or n sons. If x is the number of internal nodes of a complete n-ary tree, the number of leaves in it is given by
Respuesta
  • x(n-1)+1
  • xn-1
  • xn+1
  • x(n+1)

Pregunta 11

Pregunta
Which of the following sequences denotes the post order traversal sequence of the given tree? a / \ b e / \ / c d f / g
Respuesta
  • f e g c d b a
  • g c b d a f e
  • g c d b f e a
  • f e d g c b a
Mostrar resumen completo Ocultar resumen completo

Similar

Fórmulas Geométricas (Áreas)
Diego Santos
Miembro Superior
maca.s
Retribuciones a Empleados
owem_039
Organigramas
Diego Santos
Deeper Learning
Maya V.
FUNDAMENTOS DE LA LOGÍSTICA
amorsitoliss
Mapa Mental Estructura gramatical presente simple inglés
JOWANI BELLO MELO
GEOGRAFIA
ROSA MARIA ARRIAGA
Tipos de funciones
Karla Leyva
Como realizar un resumen y la importancia de estrategias de comprension lectora en este proceso
Lizbeth Dayann CAMINO MARTINEZ