C Programming Language by Brian W. Kernighan & Dennis M. Ritchie

C Programming Language by Brian W. Kernighan & Dennis M. Ritchie

Author:Brian W. Kernighan & Dennis M. Ritchie [Kernighan, Brian W. & Ritchie, Dennis M.]
Language: eng
Format: epub
Amazon: 0131103628
Published: 2011-11-02T10:02:38+00:00


To find out whether a new word is already in the tree, start at the root and compare the new word to the word stored at that node. If they match, the question is answered affirmatively. If the new record is less than the tree word, continue searching at the left child, otherwise at the right child. If there is no child in the required direction, the new word is not in the tree, and in fact the empty slot is the proper place to add the new word. This process is recursive, since the search from any node uses a search from one of its children. Accordingly, recursive routines for insertion and printing will be most natural.

Going back to the description of a node, it is most conveniently represented as a structure with four components:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.