You need to write a program invert to do the index construction. The input to the program is the document collection. The output includes two files - a dictionary file and a postings lists file. Each entry in the dictionary should include a term, its document frequency and a link to its postings list. You should use a proper data structure to build the dictionary (e.g. hashing or search tree or others). The structure should be easy for random lookup and insertion of new terms. All the terms should be sorted in alphabetical order. Postings list for each term should include postings for all documents the term occurs in (in the order of document ID), and the information saved in a posting includes document ID, term frequency in the document, and positions of all occurrences of the term in the document.
i have created both files and read each term and saved them in this hashmap

1
private static HashMap<dictionary, List<postings>> index = new HashMap<dictionary , List<postings>>();

how do i create this link because for the second program i run it with both txt files that are created from invert.java my dictionary.txt only consists of term and ferquency and how do i create this link? for my second program to read?

You need to write the second program test to test your inverting program. The inputs to the program are the two files generated from the previous program invert.