Skip to Main Content
Data Structures Using C, 2nd Edition by Pearson
book

Data Structures Using C, 2nd Edition by Pearson

by A. K. Sharma
May 2024
Intermediate to advanced content levelIntermediate to advanced
521 pages
14h 12m
English
Pearson India
Content preview from Data Structures Using C, 2nd Edition by Pearson
308 Data Structures Using C
if (result == 1)
printf (“\n Search Successful”);
else
printf (“\n Search Un-Successful”);
}
struct binNode *createBinTree()
{
} /* this function createBinTree() is same as developed in above examples */
int searchBST (struct binNode *binTree, int val)
{ int flag;
if (binTree == NULL)
return 0;
if (val == binTree->val)
return 1;
else
if (val < binTree-> val)
flag=searchBST(binTree->leftChild, val);
else
flag=searchBST(binTree->rightChild, val);
return flag;
}
The above program has been tested.
7.5.2.3 Insertion into a Binary Search Tree The insertion in a BST is basically a search operation.
The item to be inserted is searched within ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Structures Using C

Data Structures Using C

Samir Kumar Bandyopadhyay, Kashi Nath Dey
Intermediate C Programming, 2nd Edition

Intermediate C Programming, 2nd Edition

Yung-Hsiang Lu, George K. Thiruvathukal

Publisher Resources

ISBN: 9781299831582