-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathalgo.html
More file actions
123 lines (119 loc) · 3.22 KB
/
Copy pathalgo.html
File metadata and controls
123 lines (119 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=yes"
/>
<title>algo</title>
<style type="text/css">
code {
white-space: pre-wrap;
}
span.smallcaps {
font-variant: small-caps;
}
span.underline {
text-decoration: underline;
}
div.column {
display: inline-block;
vertical-align: top;
width: 50%;
}
</style>
</head>
<body>
<p>
What data structure is needed to make a recursive procedure? Question:
</p>
<p>Answer: O Stack O Array O Priority list</p>
<p><br /></p>
<p>❓ Queue</p>
<p>What’s the best use for a tree?</p>
<p>Answer:</p>
<p><br /></p>
<p>❓ Recursion</p>
<p>CO Index records in a data base</p>
<p><br /></p>
<p>❓ Print spooling</p>
<p>CO Image processing</p>
<p><br /></p>
<p>❓ Multiplexing datagram</p>
<p>
What’s the temporary complexity of inserting an element in a balanced tree
in the worst case? Answer: O o(n^2) O o(1) O O(log n) O O(n^n)
</p>
<p>Given the following pseudo-code:</p>
<pre><code>printTree(tree) {
if (tree.hasLeft) {
printTree(tree left)
}
if (tree.hasRight) {
printTree(tree.right);
}
print(currentNode);
}
What would be the outcome for the following tree?
10
5 23
2 7 18 31
5</code></pre>
<p><br /></p>
<p>❓ 2-5-5-7-10-18-23-31</p>
<p><br /></p>
<p>❓ 10-5-23-2-7-18-31-5</p>
<p><br /></p>
<p>❓ 2-5-7-5-18-31-23-10</p>
<p><br /></p>
<p>❓ 5-2-7-18-31-5-23-10</p>
<p>Answer:</p>
<p>
Answer: If you had to order a very large array stored in a disk that
doesn’t fit in memory. What algorithm would you use?
</p>
<p>O Bubble sort O Merge sort O Quick sort</p>
<p>O Heap sort</p>
<p>
What method would you use to search a number in an organized array of
numbers
</p>
<p>Answer:</p>
<p><br /></p>
<p>❓ Linear Search</p>
<p>
CO Fillin a hash table and then search by that hash CO Fill in a binary
tree and then search in the tree
</p>
<p><br /></p>
<p>
❓ Binary Search ? Assuming that the executing time of an algorithm has a
quadratic growth rate. For an input size of 1000 it has an execution time
of 20 ms. Which would be your estimate time of execution for an input of
size 10000
</p>
<p>Answer:</p>
<p><br /></p>
<p>❓ 2000 ms</p>
<p>
There is a Testing method usually used to verify a code, among other
things. How is this Testing method called? Question:
</p>
<p>oO Gray box testing</p>
<p><br /></p>
<p>❓ Black box testing</p>
<p><br /></p>
<p>❓ White box testing oO Compatibility testing</p>
<p><br /></p>
<p>❓ Performance testing</p>
<p>
Answer: What’s the temporary complexity of the Merge Sort algorithm in the
worst case?
</p>
<p><br /></p>
<p>❓ o(n^2) O o(n)</p>
<p>oO O(n logn) oO O(n^n)</p>
</body>
</html>