(i) WAP to create, insert, search and delete operations in a binary search tree (BST). (ii) In this question, with the help of BST , develop a file search utility in which the user will be asked to...


(i) WAP to create, insert, search and delete operations in a binary search tree (BST).


(ii) In this question, with the help of BST , develop a file search utility in which the user will be
asked to enter a word to be searched in a text file. As an output, the program should print (a) total
number of occurrences of the given word in the text file (b) Line numbers in which the given word
is present.
In order to construct the BST, scan each word of the text file. Let the first word of the file be the
root node of the BST. So, the second word, be its left child or right child, will depend on the value
returned by STRCMP (firstword, secondword) function. If the returned value is positive then the
second word will be the left child. If the returned value is negative then the second word will be the
right child. Similarly, the whole BST can be constructed. With each node, a linked list should be
associated to store the line numbers on which the word occurs. So, a node in the linked list will
have three fields, (a) line number, (b) number of occurrences of the word in that line number (c)
pointer to the next node.



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here