이진탐색트리 구현 프로그램 cpp
- 최초 등록일
- 2021.03.04
- 최종 저작일
- 2020.11
- 13페이지/ MS 워드
- 가격 1,500원
목차
1. 소스코드
2. 실행화면
본문내용
BSTNode.h 헤더파일
#ifndef BSTNODE_H
#define BSTNODE_H
class BST; //전방 선언
class Node {
friend class BST;
private:
int data;
Node* LeftChild;
Node* RightChild;
};
class BST {
private:
Node* root;
public:
BST() { root = 0; }; //생성자 (빈 트리)
void inorder(); //중위순회호출함수
void inorder(Node* CurrentNode); //중위순회함수
bool IterSearch(const int& x); //탐색함수
bool Insert(const int& x); //삽입함수
bool remove(const int& x); //삭제함수
};
#endif // !BSTNODE_H
Bst.cpp cpp파일
#include <iostream>
using namespace std;
#include "BSTNode.h" //헤더파일 선언
void BST::inorder() {
참고 자료
없음