What does the following psuedocode output when n is 4?
product <- 1
for <- 1 to n do
product <- product * i
output product
What is the big O notation for this?
Consider the following psuedo code to search if a value key is in a linked list and an instance of the linked list. What is being output at the end of the code if key is:
node ← head, found ← false
while node != NIL and found != true do
begin
if node.data == key then
found ← true
node ← node.next
end
if found == true then
output "FOUND!"
else output "NOT FOUND!"
State the order of growth of the following functions:
10n²log n + n log² n + 2n³ + 30n + 100
Consider the following binary tree rooted at the vertex r. What are the orders of vertices in an in-order traversal?
Which of the following statements is incorrect?