Test
Final Practice
Crea una cuenta gratis para terminar este test
Guarda tu progreso y consulta tu resultado final.
¿Ya tienes cuenta? Inicia sesión
Preguntas del test (28)
1What operators must exist for an iterator class to be considered a bidirectional iterator? (Select all that apply.)
- A++
- B--
- C==
- D!=
- E*
2What operators must exist for an iterator class to be considered a random access iterator? (Select all that apply.)
- A++
- B--
- C==
- D!=
- E*
- F-
- G+
- H+=
- I>
- Jjust select all of them except for pointer
3What operators must exist for an iterator class to be considered a Forward iterator? (Select all that apply.)
- A++
- B--
- C!=
- D==
- E*
- F+=
- G-=
4What is the Value returned by fsu::g_lower_bound(0,10,G)?

- A2
- B3
- C4
- D1
- E0
5Question in Picture

- A5
- B6
- C7
- D8
- E9
6question in picture

- A7
- B8
- C9
- D10
- E0
7The algorithm fsu::g_min_element(Iterator b, Iterator e, const T& t) (sequential search) has asymptotic runtime (choose the best answer)
- AO(n)
- BO(1)
- CTheta(n)
- DThetalog(n)
8The algorithm fsu::g_pop_heap(Iterator b, Iterator e) has asymptotic runtime (choose the best answer)
- AO(log n)
- BO(n)
- CTheta(log n)
- DTheta(n)
9question in picture

- AO(n)
- BTheta(n)
- CO(log n)
- DTheta(log n)
10picture

- AΘ(log n)
- BO(log n)
- CO(1)
- DΘ(1)
11question in picture

- ATheta(N)
- BTheta(H)
- CO(N)
- DO(H)
12question in picture

- ATheta(H)
- BTheta(Log N)
- CO(N)
- DO(H)
13Define an edge move to be a call to any of the following fsu::BST<T>::Navigator operations: Initialize() (i.e., assignment to root), ++(), ++(int), --(), or --(int).
What, for a general binary search tree, should the sum of all edge moves in an inorder traversal be? (n = size)- A2*n
- B3*n
- C2*n -1
- D3*n - 1
14Define an edge move to be a call to any of the following fsu::BST<T>::Navigator operations: Initialize() (i.e., assignment to root), ++(), ++(int), --(), or --(int).
What does the calculation of the number of edge moves in a traversal illustrate about the computational complexity of the iterator increment operator fsu::BSTInorderIterator<T>::operator++() ? (n = size of tree)- A3*n
- B3*n-1
- C2*n-1
- D2*n
15Suppose we want to write Save() and Restore() routines for Binary Search Tree such that:
1. Save(file) uses a traversal of the tree to write elements sequentially to the file.
2. Restore(file) reads elements from the file sequentially and inserts them into the tree, starting with an empty tree.
Which kind of traversal will ensure that the restored tree has the same tree structure as the original? (Select ALL correct answers.)- APreorder
- BPostorder
- CLevelorder
- DSomeotherOrder
16The algorithm fsu::g_lower_bound(Iterator b, Iterator e, const T& t) (binary search) has asymptotic runtime (choose the best answer)
- AΘ(log n)
- BO(log n)
- CO(n)
- DΘ(n)
17The algorithm fsu::List<T>::Insert(Iterator& i, const T& t) has asymptotic runtime
- AO(1)
- BΘ(1)
- CO(n)
- DΘ(n)
18The algorithm fsu::Vector<T>::PushBack(const T& t) has asymptotic runtime
- AAmortized O(1)
- BAmortized O(n)
- CO(n)
- DO(1)
19The algorithm fsu::Deque<T>::PopFront() has asymptotic runtime
- AO(1)
- BΘ(n)
- CO(n)
- DΘ(1)
20Suppose we need an Ordered Set ADT in a program and we will use a container with the Ordered Set API. Which of these containers will ensure that the set insert time is O(log n), where n is the number of elements in the set?
- ARBBLT
- BRB
- CAVL
- DBinary
21The Following Tree is a legal...

- ARB
- BRBLL
- CAVL
- DBinary
22The Following tree:

- AAVL
- BRB
- CRBLL
- DBinary
23The following tree:

- AAVL
- BRB
- CRBLL
- DBinary
24The Following Tree: is a Legal...

- AAVL
- BRB
- CRBLL
- DBinary
25The following tree:

- AAVL
- BRB
- CRBLL
- DBinary
26ADT Stack is frequently used in the following roles:
- ADepth first search
- BBacktracking
- CEvaluating Postfix expressions
- DConverting infix to postfix
- Efunction calls(runtime stack)
- FRecursion
- GBreadth First search
- HBuffers
- ISimulations
27ADT Queue is frequently used in the following roles:
- ABuffers
- BBreadth first search
- CSimulations
- DRecusion
- EFunction calls(runtime stack
- FConverting infix to postfix
- GDepth first search
28Begin with the vector v = [50 , 30, 40, 5, 10, 20]
Show the vector after v.PushBack(45)- A[50 , 30, 40, 5, 10, 20, 45]
- B[45, 50 , 30, 40, 5, 10, 20]
- C[50 , 30, 40, 45, 5, 10, 20]
Información
- Descripción
- Computer Science Test sobre Final Practice, creado por top base el 05/08/2016.
- Autor
- top base
- Idioma
- English
- Visitas
- 0
- Etiquetas
- Valoración
- Aún sin valoraciones Valora este test