Deck 4: Loops

ملء الشاشة (f)
exit full mode
سؤال
Show the BST after inserting 45, 43, 100, 34, 23, and 3 into an empty BST.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
a.Suppose you need to store a list of elements, if the number of elements in the program is fixed, what data structure should you use? (array, ArrayList, or LinkedList)
b.If you have to add or delete the elements at the beginning of a list, should you use ArrayList or LinkedList?
c.If most of operations on a list involve retrieving an element at a given index, should you use ArrayList or LinkedList?
سؤال
Assume the load factor threshold is 75%. Show the hash table of size 11 after inserting entries with keys 14, 3, 24, 35, using separate chaining. Show the hash table after removing 24.
سؤال
Assume the load factor threshold is 75%. Show the hash table of size 11 after inserting entries with keys 14, 3, 24, 35, using linear probing. Show the hash table after removing 24.
سؤال
For the AVL tree in the preceding figure, show the new AVL tree after adding element 50. Which node was unbalanced? What rotation did you perform in order to rebalance the tree?
سؤال
Add the elements 40, 135, 9, 11, 3, 102, into a heap in this order. Draw the final heap.
سؤال
Suppose that the text consists of characters a, b, c, d, e, f, g, h and frequency of these characters in the text is as follows:
a: 30
b: 25
c: 40
d: 9
e: 20
f: 3
g: 12
h: 23
Draw a Huffman tree to obtain the code for these characters.
سؤال
Given the following heap, show the resulting heap after removing 62 from the heap. Given the following heap, show the resulting heap after removing 62 from the heap.  <div style=padding-top: 35px>
سؤال
Show the BST after deleting 60 from the following BST. Show the BST after deleting 60 from the following BST.  <div style=padding-top: 35px>
سؤال
Show the balance factor of each node in the following tree. Show the balance factor of each node in the following tree.  <div style=padding-top: 35px>
سؤال
Show the BST after deleting 15 from the following BST. Show the BST after deleting 15 from the following BST.  <div style=padding-top: 35px>
سؤال
Show the inorder, preorder, and postorder of the following BST. Show the inorder, preorder, and postorder of the following BST.  <div style=padding-top: 35px>
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/12
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 4: Loops
1
Show the BST after inserting 45, 43, 100, 34, 23, and 3 into an empty BST.
2
a.Suppose you need to store a list of elements, if the number of elements in the program is fixed, what data structure should you use? (array, ArrayList, or LinkedList)
b.If you have to add or delete the elements at the beginning of a list, should you use ArrayList or LinkedList?
c.If most of operations on a list involve retrieving an element at a given index, should you use ArrayList or LinkedList?
a. Array
b. LinkedList
c. ArrayList
3
Assume the load factor threshold is 75%. Show the hash table of size 11 after inserting entries with keys 14, 3, 24, 35, using separate chaining. Show the hash table after removing 24.
4
Assume the load factor threshold is 75%. Show the hash table of size 11 after inserting entries with keys 14, 3, 24, 35, using linear probing. Show the hash table after removing 24.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
5
For the AVL tree in the preceding figure, show the new AVL tree after adding element 50. Which node was unbalanced? What rotation did you perform in order to rebalance the tree?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
6
Add the elements 40, 135, 9, 11, 3, 102, into a heap in this order. Draw the final heap.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
7
Suppose that the text consists of characters a, b, c, d, e, f, g, h and frequency of these characters in the text is as follows:
a: 30
b: 25
c: 40
d: 9
e: 20
f: 3
g: 12
h: 23
Draw a Huffman tree to obtain the code for these characters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
8
Given the following heap, show the resulting heap after removing 62 from the heap. Given the following heap, show the resulting heap after removing 62 from the heap.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
9
Show the BST after deleting 60 from the following BST. Show the BST after deleting 60 from the following BST.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
10
Show the balance factor of each node in the following tree. Show the balance factor of each node in the following tree.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
11
Show the BST after deleting 15 from the following BST. Show the BST after deleting 15 from the following BST.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
12
Show the inorder, preorder, and postorder of the following BST. Show the inorder, preorder, and postorder of the following BST.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 12 في هذه المجموعة.