   What is an index file?
  Hello everyone.  I''m taking a programming class, and we were exploring reading in text/binary files.  We first did sequential files, and then we did random files.  Although the instructor said that searching the random file for a specific record would be easier if it were an index file, we arn''t actually going to do that, and are moving on to linked lists.  I was wondering if anyone could explain to me what an index file is and/or point me to a tutorial on the subject.  I have looked, but haven''t found anything usefull.Thanks in advance.   Glass_KnifeI think, therfore I am. I think? 
  I think you should first read/learn about binary trees and then it would be easy to understand what is an index file and how tocreate them.P.S. Binary trees are usually explained after linked lists ;  I have already covered linked list in another class, and I have a good idea about binary trees.  This is a starter class( some of the code examples are in basic ), that I am only taking because I need the credits to graduate.  The homework takes about 20 - 30 minutes, and since I have the extra time, I thought I''d add the index file stuff into the next assignment, just to freak him out .  The instructor said that we are going to go over the concept of a linked-list, but not actually do anything with it.  I am asking about the index file because he''s not going to cover it.  I do not think I will have any problems understanding the concept.   ;  Basically, an index file contains only the data you''re likely to search on, plus a pointer/key enabling the full record to be found in the main database file.You can find a better description athttp://www.nist.gov/dads/HTML/indexfile.htmlwhich also explains other data structure terms. ;  For some reason I had pictured in my head either a different way of storing the data, or another data file that contained the keys and record numbers.  Is the normal iplementation to read the random file, build the index file( in memory ), sort that, and use that for searches.  If the index file is also stored on the drive, then it needs to be altered when records are added, updated, and deleted.  Is is common to search the index file like a random file, or pull it into memory?  Off the top of my head I can''t see how to store data in a file in a B-Tree format. ;  Database records are usually searched and/or viewed much more often than they are altered, so the index file is stored on disk too and altered in parallel with the main db file.Fairly obviously, checks have to be made that both files remain in synch with each other, particularly if there''s a possibility that more than one user may be editing the files at the same time.If you''d like to read more about databases, including text based file storage versions, a good place to start is:-http://www.wdvl.com/Authoring/DB/The "Introduction to relational databases" articles should be generic enough for your needs. 