Clue Two fork Tree

Source: Internet
Author: User

1. What is a clue two fork tree?

There must be n+1 null pointer fields in the two-linked list with n nodes , so you can use these null pointer fields to hold pointers to the forward and subsequent nodes in some sort of traversal order that point to the node, a pointer to the forward and subsequent nodes called a "clue", Plus a clue to the two-linked list called the Clue list, the corresponding two-fork tree is called the Clue two fork tree.

2. What is the role of the Clue two fork tree?

Isn't it enough to have a two-prong tree? Then why do you have to get a clue? Two fork tree out?

In the original two-linked list, find the node of the left and right children can be directly implemented, but if you want to find the node of the pre-trend and subsequent nodes? This becomes very difficult, so in order to achieve this common requirement, we need to add two pointer fields to each node to hold the forward and subsequent nodes of the traversal, so that the forward and subsequent nodes can be accessed directly or indirectly through the pointer.

3. How can a binary tree be threaded?

Traverse the binary tree in some order, replacing the null pointer with clues in the traversal process.

Below is a clue two fork Tree and a clue two fork list , which can help us to better understand the clue two fork tree.

Can see the Clue two fork Tree , in fact, is to turn a binary tree into a doubly linked list , which for insertion and deletion, find a node is very convenient.

Clue Two fork Tree

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.