Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- typedef struct _NODE_s {
- int value;
- struct _NODE_s *left;
- struct _NODE_s *right;
- struct _NODE_S *node;
- } NODE_s;
- int search(NODE_s *root, int value) {
- NODE_s *current;
- current = root;
- while(current != NULL) {
- if(current->value==value) {
- return 1;
- }
- else if(value < current->value)
- current = current->left;
- else
- current = current->right;
- }
- return 0;
- }
- void insert(NODE_s *root, int value) {
- NODE_s *current;
- current = root;
- NODE_s *parent;
- parent = root;
- while(current != NULL) {
- if(value < current->value) {
- parent = current;
- current = current->left;
- }
- else if(value > current->value)
- parent = current;
- current = current->right;
- }
- if(value <parent->value) {
- }
- }
- int main( int argc, const char* argv[] )
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement