返回卡包市场

Tree-traversal

暂无描述。系统推荐的高质量记忆内容,适合每天坚持背诵学习。

卡片总数: 10内容版本: v4公开卡包更新时间: 8/1/2026

卡片预览 (10 张)

#1
正面 (问题)

What are the 3 most common algorithms for traversing trees?

背面 (解答)

Pre-order, post-order and in-order

#2
正面 (问题)

Define pre-order

背面 (解答)

Specifies the point in traversal where the node contents are processed

#3
正面 (问题)

What happens to a node when it’s visited?

背面 (解答)

A nodes contents are outputted

#4
正面 (问题)

How many times can a node be visited?

背面 (解答)

Multiple times but it’s contents can only be processed once

#5
正面 (问题)

What makes pre-order traversal special?

背面 (解答)

Each node is visited before the algorithm traverses either of the nodes subtrees

#6
正面 (问题)

State the simplified recursive algorithm for a left-right pre-order traversal

背面 (解答)

Visit the node Pre-order traverse of nodes left sub tree pre-order traverse of the nodes right subtree

#7
正面 (问题)

What happens in an in-order traversal?

背面 (解答)

Each node is visited between each of it’s subtrees

#8
正面 (问题)

State the simplified algorithm for a left-right in-order traversal

背面 (解答)

Do an in-order traversal of the whole left subtree visit the node in-order traverse the right subtree

#9
正面 (问题)

What happens in a post-order traversal?

背面 (解答)

Each node is visited after both of it’s subtrees

#10
正面 (问题)

State the simplified recursive algorithm for a left-right post-order traversal

背面 (解答)

Do a post-order traversal of the left subtree Do a post-order traversal of the right subtree Visit the node