博客中代码都经过运行并且没有bug
二叉链表数据结构和二叉链表的构造
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 树
{
class 二叉链表
{
/// <summary>
/// 二叉链表结点结构
/// </summary>
public class BiTNode
{
public char data;
public BiTNode lchild,rchild;//左右孩子指针
}
/// <summary>
/// 构造二叉树
/// </summary>
/// <returns></returns>
public static BiTNode InitBiTree()
{
BiTNode biTNodeA = new BiTNode() { data = 'A' };
BiTNode biTNodeB = new BiTNode() { data = 'B' };
BiTNode biTNodeC = new BiTNode() { data = 'C' };
BiTNode biTNodeD = new BiTNode() { data = 'D' };
BiTNode biTNodeE = new BiTNode() { data = 'E' };
BiTNode biTNodeF = new BiTNode() { data = 'F' };
BiTNode biTNodeG =