Advanced Algorithm (Eldan) 2 (11) Dan

Beschreibung

Quiz am Advanced Algorithm (Eldan) 2 (11) Dan, erstellt von Alex Q am 24/12/2017.
Alex Q
Quiz von Alex Q, aktualisiert more than 1 year ago
Alex Q
Erstellt von Alex Q vor mehr als 6 Jahre
47
2

Zusammenfassung der Ressource

Frage 1

Frage
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?
Antworten
  • LASTIN = LASTPOST
  • LASTIN = LASTPRE
  • LASTPRE = LASTPOST
  • None of the above

Frage 2

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

Frage 3

Frage
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
Antworten
  • p
  • p + 1
  • n - p
  • n - p + 1

Frage 4

Frage
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
Antworten
  • 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

Frage 5

Frage
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
Antworten
  • Hamiltonian cycle
  • grid
  • hypercube
  • tree

Frage 6

Frage
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?
Antworten
  • 35
  • 64
  • 5040
  • 128

Frage 7

Frage
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.
Antworten
  • 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

Frage 8

Frage
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)?
Antworten
  • 1 and 3 only
  • 2 and 3 only
  • 2, 3 and 4 only
  • 1, 2, and 3

Frage 9

Frage
Which of the following statement is false?
Antworten
  • 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)

Frage 10

Frage
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
Antworten
  • x(n-1)+1
  • xn-1
  • xn+1
  • x(n+1)

Frage 11

Frage
Which of the following sequences denotes the post order traversal sequence of the given tree? a / \ b e / \ / c d f / g
Antworten
  • 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
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Checkfragen - Kapitel 1: Empirische Sozialforschung und empirische Theorie
Melanie Najm
IELTS- Vokabeln
anna.grillborzer0656
KPOL PuKW
Mona Les
VOKABELN- Deutsch-Englisch
Helene Hanna
PR VO part2
Anda Muresan
INNO Klausur 1
Inno 2015
Shakespeare
Antonia C
Pädagogik Abitur 2016: Piaget
Lena S.
Vetie Pharma 2016
E. König
vetie Para 2016
Anne Heyne
Vetie - Berufsrecht 2016
Kim Langner