Deck 9: Searching and Sorting

ملء الشاشة (f)
exit full mode
سؤال
A collection where each node can have from 0 to 2 children is called a ___________.

A) Stack
B) Queue
C) List
D) Binary tree
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
A node that does not have a parent is called the ______ of a tree.

A) foot
B) root
C) leaf
D) top
سؤال
A tree is a nonlinear structure whose elements are organized into a __________.

A) stack
B) hierarchy
C) queue
D) list
سؤال
The simulated link strategy allows array positions to be allocated contiguously regardless of the _________ of the tree.

A) size
B) order
C) completeness
D) root
سؤال
In general, a balanced n-ary tree with m elements will have height _______.

A) lognm
B) logmm
C) logmn
D) lognn
سؤال
There are four basic methods for traversing a tree: preorder, inorder, postorder, and level-order.

A) Top down, bottom up, inorder, and postorder
B) Top down, inorder, postorder, and level-order
C) Bottom up, preorder, in order, and postorder
D) preorder, inorder, postorder, and level-order
سؤال
_________ traversal means visit the node, then the left child, then the right child.

A) preorder
B) postorder
C) inorder
D) level-order
سؤال
_________ traversal means visit the left child, then the node, then the right child.

A) preorder
B) postorder
C) inorder
D) level-order
سؤال
________ traversal means visit the left child, then the right child, then the node.

A) preorder
B) postorder
C) inorder
D) level-order
سؤال
___________ traversal means visit the nodes at each level, one level at at time, starting with the root.

A) preorder
B) postorder
C) inorder
D) level-order
سؤال
In the computational strategy to implement a tree with an array, the children of node n are stored at 2n + 1 and 2(n + 1) respectively.

A) 2n + 1
B) 2n + 2
C) 2(n + 1)
D) A and B
E) A and C
F) B and C
سؤال
A node that does not have a ______ is called the root of a tree.
سؤال
A collection where each node can have from 0 to 2 children is called a ______ Tree.
سؤال
A node that has both a parent and at least one child is called a(n) ______ node.
سؤال
A balanced N-ary tree with n elements will have height ______.
سؤال
  -For the tree shown above, list the root.<div style=padding-top: 35px>
-For the tree shown above, list the root.
سؤال
  -For the tree shown above, list the leaves.<div style=padding-top: 35px>
-For the tree shown above, list the leaves.
سؤال
  -What is the height of the tree shown above?<div style=padding-top: 35px>
-What is the height of the tree shown above?
سؤال
  -For the binary tree shown, list the elements in the order generated by an InOrder traversal.<div style=padding-top: 35px>
-For the binary tree shown, list the elements in the order generated by an InOrder traversal.
سؤال
  -For the binary tree shown, list the elements in the order generated by an PreOrder traversal.<div style=padding-top: 35px>
-For the binary tree shown, list the elements in the order generated by an PreOrder traversal.
سؤال
  -For the binary tree shown, list the elements in the order generated by an PostOrder traversal.<div style=padding-top: 35px>
-For the binary tree shown, list the elements in the order generated by an PostOrder traversal.
سؤال
  -A ______ is a nonlinear structure whose elements are organized into a hierarchy.<div style=padding-top: 35px>
-A ______ is a nonlinear structure whose elements are organized into a hierarchy.
سؤال
  -The ______ strategy allows array positions to be allocated contiguously regardless of the completeness of the tree.<div style=padding-top: 35px>
-The ______ strategy allows array positions to be allocated contiguously regardless of the completeness of the tree.
سؤال
  -In general, a balanced n-ary tree with m elements will have height ______.<div style=padding-top: 35px>
-In general, a balanced n-ary tree with m elements will have height ______.
سؤال
  -There are four basic methods for traversing a tree: ______.<div style=padding-top: 35px>
-There are four basic methods for traversing a tree: ______.
سؤال
  -Preorder traversal means ______.<div style=padding-top: 35px>
-Preorder traversal means ______.
سؤال
  -Inorder traversal means ______.<div style=padding-top: 35px>
-Inorder traversal means ______.
سؤال
  -Postorder traversal means ______.<div style=padding-top: 35px>
-Postorder traversal means ______.
سؤال
  -Level-order traversal means ______.<div style=padding-top: 35px>
-Level-order traversal means ______.
سؤال
  -In the computational strategy to implement a tree with an array, the children of node n are stored at _____.<div style=padding-top: 35px>
-In the computational strategy to implement a tree with an array, the children of node n are stored at _____.
سؤال
The binary tree shown above is balanced.
سؤال
The binary tree shown above is complete.
سؤال
A collection where each node can have from 0 to 3 children is called a Binary Tree.
سؤال
A find operation on a balanced binary search tree is O(logn) where as a find operation for binary search tree without the balance assumption is O(n).
سؤال
A node that has a parent is called the root of a tree.
سؤال
A tree is a nonlinear structure whose elements are organized into a hierarchy.
سؤال
The simulated link strategy does not allow array positions to be allocated contiguously regardless of the completeness of the tree.
سؤال
In general, a balanced n-ary tree with m elements will have height lognm.
سؤال
Preorder traversal means visit the left child, then the right child, then the node.
سؤال
Inorder traversal means visit the left child, then the node, then the right child.
سؤال
Postorder traversal means visit the node, then the left child, then the right child.
سؤال
Level-order traversal means visit the nodes at each level, one level at at time, starting with the root.
سؤال
In the computational strategy to implement a tree with an array, the children of node n are stored at 2n + 1 and 2(n + 1) respectively.
سؤال
What is a tree?
سؤال
What is a node?
سؤال
What is the root of the tree?
سؤال
What is a leaf?
سؤال
Define the height of a tree.
سؤال
Define the level of a node.
سؤال
What are the advantages and disadvantages of the computational strategy?
سؤال
What are the advantages and disadvantages of the simulated link strategy?
سؤال
What attributes should be stored in the TreeNode class?
سؤال
Which method of traversing a tree would result in a sorted list for a binary search tree?
سؤال
We used a list to implement the iterator methods for a binary tree. What must be true for this strategy to be successful?
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/54
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 9: Searching and Sorting
1
A collection where each node can have from 0 to 2 children is called a ___________.

A) Stack
B) Queue
C) List
D) Binary tree
Binary tree
2
A node that does not have a parent is called the ______ of a tree.

A) foot
B) root
C) leaf
D) top
root
3
A tree is a nonlinear structure whose elements are organized into a __________.

A) stack
B) hierarchy
C) queue
D) list
hierarchy
4
The simulated link strategy allows array positions to be allocated contiguously regardless of the _________ of the tree.

A) size
B) order
C) completeness
D) root
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
5
In general, a balanced n-ary tree with m elements will have height _______.

A) lognm
B) logmm
C) logmn
D) lognn
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
6
There are four basic methods for traversing a tree: preorder, inorder, postorder, and level-order.

A) Top down, bottom up, inorder, and postorder
B) Top down, inorder, postorder, and level-order
C) Bottom up, preorder, in order, and postorder
D) preorder, inorder, postorder, and level-order
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
7
_________ traversal means visit the node, then the left child, then the right child.

A) preorder
B) postorder
C) inorder
D) level-order
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
8
_________ traversal means visit the left child, then the node, then the right child.

A) preorder
B) postorder
C) inorder
D) level-order
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
9
________ traversal means visit the left child, then the right child, then the node.

A) preorder
B) postorder
C) inorder
D) level-order
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
10
___________ traversal means visit the nodes at each level, one level at at time, starting with the root.

A) preorder
B) postorder
C) inorder
D) level-order
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
11
In the computational strategy to implement a tree with an array, the children of node n are stored at 2n + 1 and 2(n + 1) respectively.

A) 2n + 1
B) 2n + 2
C) 2(n + 1)
D) A and B
E) A and C
F) B and C
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
12
A node that does not have a ______ is called the root of a tree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
13
A collection where each node can have from 0 to 2 children is called a ______ Tree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
14
A node that has both a parent and at least one child is called a(n) ______ node.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
15
A balanced N-ary tree with n elements will have height ______.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
16
  -For the tree shown above, list the root.
-For the tree shown above, list the root.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
17
  -For the tree shown above, list the leaves.
-For the tree shown above, list the leaves.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
18
  -What is the height of the tree shown above?
-What is the height of the tree shown above?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
19
  -For the binary tree shown, list the elements in the order generated by an InOrder traversal.
-For the binary tree shown, list the elements in the order generated by an InOrder traversal.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
20
  -For the binary tree shown, list the elements in the order generated by an PreOrder traversal.
-For the binary tree shown, list the elements in the order generated by an PreOrder traversal.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
21
  -For the binary tree shown, list the elements in the order generated by an PostOrder traversal.
-For the binary tree shown, list the elements in the order generated by an PostOrder traversal.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
22
  -A ______ is a nonlinear structure whose elements are organized into a hierarchy.
-A ______ is a nonlinear structure whose elements are organized into a hierarchy.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
23
  -The ______ strategy allows array positions to be allocated contiguously regardless of the completeness of the tree.
-The ______ strategy allows array positions to be allocated contiguously regardless of the completeness of the tree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
24
  -In general, a balanced n-ary tree with m elements will have height ______.
-In general, a balanced n-ary tree with m elements will have height ______.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
25
  -There are four basic methods for traversing a tree: ______.
-There are four basic methods for traversing a tree: ______.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
26
  -Preorder traversal means ______.
-Preorder traversal means ______.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
27
  -Inorder traversal means ______.
-Inorder traversal means ______.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
28
  -Postorder traversal means ______.
-Postorder traversal means ______.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
29
  -Level-order traversal means ______.
-Level-order traversal means ______.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
30
  -In the computational strategy to implement a tree with an array, the children of node n are stored at _____.
-In the computational strategy to implement a tree with an array, the children of node n are stored at _____.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
31
The binary tree shown above is balanced.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
32
The binary tree shown above is complete.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
33
A collection where each node can have from 0 to 3 children is called a Binary Tree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
34
A find operation on a balanced binary search tree is O(logn) where as a find operation for binary search tree without the balance assumption is O(n).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
35
A node that has a parent is called the root of a tree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
36
A tree is a nonlinear structure whose elements are organized into a hierarchy.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
37
The simulated link strategy does not allow array positions to be allocated contiguously regardless of the completeness of the tree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
38
In general, a balanced n-ary tree with m elements will have height lognm.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
39
Preorder traversal means visit the left child, then the right child, then the node.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
40
Inorder traversal means visit the left child, then the node, then the right child.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
41
Postorder traversal means visit the node, then the left child, then the right child.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
42
Level-order traversal means visit the nodes at each level, one level at at time, starting with the root.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
43
In the computational strategy to implement a tree with an array, the children of node n are stored at 2n + 1 and 2(n + 1) respectively.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
44
What is a tree?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
45
What is a node?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
46
What is the root of the tree?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
47
What is a leaf?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
48
Define the height of a tree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
49
Define the level of a node.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
50
What are the advantages and disadvantages of the computational strategy?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
51
What are the advantages and disadvantages of the simulated link strategy?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
52
What attributes should be stored in the TreeNode class?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
53
Which method of traversing a tree would result in a sorted list for a binary search tree?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
54
We used a list to implement the iterator methods for a binary tree. What must be true for this strategy to be successful?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 54 في هذه المجموعة.