Which traversal algorithm is used to visit all nodes of a binary tree in a specific order?
- In-order
- Level-order
- Post-order
- Pre-order
Pre-order traversal is used to visit all nodes of a binary tree in a specific order. In this traversal, the nodes are visited in the order of root, left subtree, and then right subtree, making it useful for certain operations like copying a tree.
Loading...
Related Quiz
- How does a switch determine the destination of a data packet within a LAN?
- NAT allows multiple devices within a local network to share a single ________ IP address.
- In Agile development, user stories are typically written in the format of "As a ___________, I want to ___________, so that ___________."
- What is the correct syntax for declaring a variable in JavaScript?
- The process of converting plaintext into ciphertext using a secret key is known as ___________.