Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
fbc37e7d
Commit
fbc37e7d
authored
Feb 24, 2005
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 2-3 tree header file
git-svn-id:
https://svn.musicpd.org/mpd/trunk@2982
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
c5a31e1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
tree.h
src/tree.h
+51
-0
No files found.
src/tree.h
0 → 100644
View file @
fbc37e7d
#ifndef TREE_H
#define TREE_H
typedef
struct
_TreeNode
{
void
*
data
[
2
];
struct
_TreeNode
*
children
[
3
];
struct
_TreeNode
*
parent
;
}
TreeNode
;
typedef
struct
_Tree
{
TreeNode
headNode
;
TreeFreeDataFunc
*
freeFunc
;
TreeCompareDataFunc
*
compareFunc
;
}
Tree
;
typedef
enum
_TreeIteratorType
{
PREORDER
,
INORDER
,
POSTORDER
}
TreeIteratorType
;
typedef
struct
_TreeIterator
{
Data
*
data
;
/* private data */
TreeIteratorType
type
;
TreeNode
*
currentNode
;
int
pos
;
}
TreeIterator
;
typedef
int
TreeCompareDataFunc
(
void
*
left
,
void
*
right
);
typedef
int
TreeFreeDataFunc
(
void
*
data
);
Tree
*
newTree
(
TreeFreeDataFunc
*
freeFunc
,
TreeCompareDataFunc
*
compareFunc
);
void
freeTree
(
Tree
*
tree
);
int
insertInTree
(
Tree
*
tree
,
void
*
data
);
int
deleteFromTree
(
Tree
*
tree
,
void
*
needle
);
void
*
findInTree
(
Tree
*
tree
,
void
*
needle
);
TreeIterator
*
newTreeIterator
(
Tree
*
tree
,
TreeIteratorType
type
);
/* will return the same pointer passed in on success
* if NULL is returned, this indicates the end of tree
*/
TreeIterator
*
nextTreeIterator
(
TreeIterator
*
iter
);
#endif // TREE_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment