Mena Sargios
Test por , creado hace más de 1 año

Algorithms and Data Structures | Test 3 Review | CSCI-3110-002 MTSU

2911
0
0
Mena Sargios
Creado por Mena Sargios hace más de 7 años
Cerrar

2. Red Black Tree

Pregunta 1 de 19

1

What color must the leaves be in a red-black tree?

Selecciona una de las siguientes respuestas posibles:

  • Black

  • Red

Explicación

Pregunta 2 de 19

1

The number of black nodes from the root to a node is the node's
____ ______; the uniform number of black nodes in all paths from
root to the leaves is called the ____ _____ of the red–black tree.

Selecciona una de las siguientes respuestas posibles:

  • A) red height, red depth

  • B) red depth, red height

  • C) black depth, black height

  • D) black height, black depth

Explicación

Pregunta 3 de 19

1

What makes a tree a red-black tree?

Selecciona una de las siguientes respuestas posibles:

  • An extra bit on each node which determines the color to help balance it.

  • none of the above

Explicación

Pregunta 4 de 19

1

If a node is red, what color are its children?

Selecciona una de las siguientes respuestas posibles:

  • A) Red

  • B) Black

  • C) Blue

  • D) Red node has to be leaf

Explicación

Pregunta 5 de 19

1

What are the Red and black colors used for?

Selecciona una de las siguientes respuestas posibles:

  • A.to make it easier to read

  • B.they serve no purpose

  • C.they show the nodes with no children

  • D.They are part of the balancing of the tree

Explicación

Pregunta 6 de 19

1

What time does A red-black tree gurantee for searching?

Selecciona una de las siguientes respuestas posibles:

  • O(log n) time

  • none of the above

Explicación

Pregunta 7 de 19

1

In a Red-Black Tree, the root of tree is always black.

Selecciona uno de los siguientes:

  • VERDADERO
  • FALSO

Explicación

Pregunta 8 de 19

1

In a red black tree, every node is either red or black?

Selecciona uno de los siguientes:

  • VERDADERO
  • FALSO

Explicación

Pregunta 9 de 19

1

In a Red-Black Tree, if a node is red, its child must be _________.

Selecciona una de las siguientes respuestas posibles:

  • Black

  • Red

Explicación

Pregunta 10 de 19

1

What is the searching time of a red-black tree?

Selecciona una de las siguientes respuestas posibles:

  • A) O(n log n)

  • B) O(log n)

  • C) O(n^2)

  • D) O(n)

Explicación

Pregunta 11 de 19

1

What is the Average case of this tree's properties?

Selecciona una de las siguientes respuestas posibles:

  • a. Only space is O(log n)

  • b. Only space is (log n)

  • c. All but space is O(log n)

  • d. None of the above

Explicación

Pregunta 12 de 19

1

In order to insert a red node into a red-black tree, the parent of the inserted node must be:

Selecciona una de las siguientes respuestas posibles:

  • A. Red

  • B. Black

  • C. Green

  • D. Blue

Explicación

Pregunta 13 de 19

1

What is a red-black tree?

Selecciona una de las siguientes respuestas posibles:

  • A) A tree with a dark red color

  • B) A tree requiring to be balanced every time a node is added

  • C) A self-balancing binary search tree

  • D) None of the above

Explicación

Pregunta 14 de 19

1

Which of the following is NOT correct when inserting a new node into a red-black tree?

Selecciona una de las siguientes respuestas posibles:

  • A. if the new node is not the root, then it starts as red

  • B. if the new node is the root, then it starts as red

  • C. if the new node's parent is black, the insertion step is done

  • D. if the new node's parent is red and the new node's uncle is black, a rotation will be done before recoloring

Explicación

Pregunta 15 de 19

1

A red-black tree is a binary search tree that has which of the following red-black properties?

Selecciona una de las siguientes respuestas posibles:

  • A. Every node is either red or black, and every leaf (NULL) is black.

  • B. If a node is red, then both its children are black.

  • C. Every simple path from a node to a descendant leaf contains the same number of black nodes.

  • D. All of the above

Explicación

Pregunta 16 de 19

1

When dealing with a red black tree, it is ok to have a red root.

Selecciona uno de los siguientes:

  • VERDADERO
  • FALSO

Explicación

Pregunta 17 de 19

1

A red–black tree is a kind of self-balancing binary search tree. Each node of the binary tree has an extra bit, and that bit is often interpreted as the color (red or black) of the node.
Which is not correct the following statements about the properties of red black tree?

Selecciona una de las siguientes respuestas posibles:

  • a. All leaves (NIL) are black. A node is either red or black.

  • b. The root is black. This rule is sometimes omitted. Since the root can always be changed from red to black, but not necessarily vice versa, this rule has little effect on analysis.

  • c. If a node is red, then both its children are black.

  • d. All leaves (NIL) are not black.

Explicación

Pregunta 18 de 19

1

which one is not right about the red_black tree?

Selecciona una de las siguientes respuestas posibles:

  • A. A red_black tree is a binary search tree.

  • B. In the average case, the time complexity of searching one member of the red_black tree is O(logn).

  • C. In the average case, the time complexity of inserting one member into the red_black tree is O(logn).

  • D. An AVL tree is better than a red_black tree with same data memebers in searching, insert and so on.

Explicación

Pregunta 19 de 19

1

At most, what is the max height of a red black tree?

Selecciona una de las siguientes respuestas posibles:

  • A) 2Log(N)

  • B) Log(N!)

  • C) 2Log(N+1)

  • D) 2e^(N+1)

Explicación