logo

Crowdly

Browser

Add to Chrome

MATH348 - Graph Theory and Application SEJ G1 - F26

Looking for MATH348 - Graph Theory and Application SEJ G1 - F26 test answers and solutions? Browse our comprehensive collection of verified answers for MATH348 - Graph Theory and Application SEJ G1 - F26 at moodle.medtech.tn.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Given the TreeNode structure built in Part 3:

root = TreeNode("A")

b, c, d, e, f = [TreeNode(x) for x in "BCDEF"]

root.add_child(b)

root.add_child(c)

root.add_child(d)

c.add_child(e)

c.add_child(f)

What are the expected outputs of preorder(root) and postorder(root) respectively?

❌
❌
✅
View this question

Using the action history tree from Part 5, what are the values of match.value for:

match1 = find_node(history, "Delete line")

match2 = find_node(history, "Save file")

❌
❌
✅
View this question

In Part 1 of the lab, you are given the following graph representation:

tree = {

1: {2},

2: {1, 3, 4},

3: {2},

4: {2, 5, 6},

5: {4},

6: {4}

}

What is the exact list returned by calling prufer_encode(tree)?

✅
❌
❌
❌
View this question

In the lab, you perform the following round-trip verification test:

seq = [2, 4, 4, 2]

decoded_tree = prufer_decode(seq)

print(prufer_encode(decoded_tree) == seq)

If both functions are implemented correctly, what is printed?

✅
❌
❌
View this question

In the TODO instructions for prufer_encode(tree), why is step 1 instructed to copy the adjacency sets of the dictionary?

❌
❌
✅
View this question

For values = [10, 20, 30, 40, 50, 60], what list does array_preorder(values) return?

(Format answer exactly as a Python list string, e.g. [1, 2, 3])

View this question

In prufer_decode(sequence), after processing all elements in the input sequence list, what final step completes the graph reconstruction?

❌
❌
✅
View this question

In Part 4, you write the recursive inner function visit(i) for array_preorder(values):

def array_preorder(values):

result = []

def visit(i):

# TODO

pass

if values:

visit(0)

return result

Which recursive call pattern correctly fills result in preorder for an array representation?

❌
❌
✅
View this question

In Part 3, you construct a binary tree using BinaryNode:

binary_root = BinaryNode(

8,

BinaryNode(3, BinaryNode(1), BinaryNode(6)),

BinaryNode(10, None, BinaryNode(14))

)

What list does inorder(binary_root) produce?

✅
❌
❌
View this question

In Part 5, you implement find_node(node, target) to perform Depth-First Search on an action history tree:

history = TreeNode("Start")

type_text = TreeNode("Type text")

open_file = TreeNode("Open file")

add_title = TreeNode("Add title")

delete_line = TreeNode("Delete line")

history.add_child(type_text)

history.add_child(open_file)

type_text.add_child(add_title)

type_text.add_child(delete_line)

Which Python snippet correctly implements DFS to locate a target node?

❌
❌
✅
View this question

Want instant access to all verified answers on moodle.medtech.tn?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome