소개글
c 기반이며, stack을 이용하여 b-tree를 구현했습니다. 소스코드는 23페이지이며, 13페이지 분량의 report도 첨부합니다. 주석 처리 깔끔하게 했으며 추가 점수 받은 과제입니다.
컴파일 실행환경
gcc /
windows / unix compatible
본문내용
#include <stdio.h>
#include <malloc.h>
#include <string.h>
/* -------------------------------------
preprocessor
------------------------------------- */
#define DEGREE 5 /* b-tree의 차수 */
#define MAX_ELEMENTS 1000 /* 입력되는 key의 개수의 상한 지정 */
#define DELETE_COUNT 10 /* 삭제시 빼줄 element 개수 */
/* -------------------------------------
global variables
------------------------------------- */
FILE* pInputStream; /* input 파일의 핸들 */
FILE* pOutputStream; /* output 파일의 핸들 */
/* -------------------------------------
B-tree의 node structure
------------------------------------- */
struct NODE
{
int bRoot;
int nElm[DEGREE-1];
void* pChild[DEGREE];
};
/* -------------------------------------
B-tree의 overflow node의 structure
------------------------------------- */
struct OVERFLOW_NODE
{
int bRoot;
int nElm[DEGREE];
void* pChild[DEGREE+1];
};
압축파일 내 파일목록
btree.doc
BTree.c
참고 자료
없음