Professional Documents
Culture Documents
Indexing mechanism used to speed up access to desired data. e.g author catalog in library.
Search key is nothing but an attribute or a set of attributes used to look up records.
Other than the main file where records are stored, index file is created.
An index file consists of records of the form
To find a specific record for the given key value, index file is searched for the given key value.
#include<stdio.h>
#include<stdlib.h>
typedef struct
{
float key; //key
int ptr; //pointer position of key
}Index;
int main()
{
float a[20]; //sorted array of elements
Index in[5]; //index array
float ele; //data to be searched
return 0;
}