본문 바로가기

자료구조/Binary Tree

기본 설정

이진 트리를 사용하기 위한 링크 설정

struct Node{
    int value;
    struct Node *Llink;
    struct Node *Rlink;
};

 

처음엔 값이 없으므로 null로 정의 한다.

 struct Node *head = (struct Node *) malloc(sizeof(Node));

    head -> Llink = nullptr, head -> Rlink = nullptr;

'자료구조 > Binary Tree' 카테고리의 다른 글

전위, 중위, 후위 구현  (0) 2022.05.02
트리 구현  (0) 2022.05.02