Tuesday, November 29, 2005

Searching (UNIT III)

1) What are internal keys or embedded keys and external keys?
The key that is contained with in the record at a specific offset from the start of the record is called internal key or embedded key. The separate tables of keys that include pointers to the records are called external keys.


2) What is a primary key and secondary key?
The set of keys that is uniquely used to differentiate any two records is called primary key. The fields of a record which may not be unique is used for a particular search is called secondary key.

3) What is a search algorithm?
Search algorithm is an algorithm that accepts an argument a and tries to find a record whose key is a. It may return the entire record or a pointer to that record. If there is no match it return NULL record or NULL pointer.

4) What is search and insertion algorithm?
If the search is unsuccessful, a new record will be added to the table with the argument as key. This type of algorithm is called search algorithm.

5) What is search table or dictionary?
A table of records in which a key is used for retrieval is called search table or dictionary.

6) What are internal searches and external searches?
Searches in which the entire table is constantly in main memory are called internal searches; whereas that in which most of the table is kept in auxiliary storage is called external searches.

7) What is an ordered table?
The table in which there is a presumed relation exists among the records or their associated keys are called ordered table. The table that does not have any such specific relationship is called unordered table.

8) Write the simple procedure for sequential search.
For (i=0;i

No comments: