public void Keywords(int page) {

    /**
     * HashTable1 class is responsible for this action. It uses the page number as a keyword and
     * stores all the keywords with that page number Observe the implementation of HashTable1 for
     * further information
     */
    int counter; // number of keywords in the given page

    ListNode result =
        ht1.chainedHashSearch(ht1, page); // find the first occurence of the page number

    if (result != null) { // if not null
      counter = 1;

      while (result.getNext() != null) {

        result = result.getNext();
        if (result.getPage()
            == page) { // if equal to the given page number and not equal to the previous result's
                       // page number
          counter++;
        }
      }

      String kwordArr[] = new String[counter];
      counter = 1;
      result =
          ht1.chainedHashSearch(ht1, page); // again go to the first node with the given keyword
      kwordArr[0] = result.getKeyword();

      while (result.getNext() != null) {

        result = result.getNext();
        if (page
            == result
                .getPage()) { // if equal to the given page number and not equal to the previous
                              // result's page number
          kwordArr[counter] = result.getKeyword();
          counter++;
        }
      }

      this.stringSort(kwordArr); // send the array for sorting

    } else {
      System.out.println("Invalid Page Number");
    }
  }
  public int[] List(String keyword) {
    int counter = 0; // this counts the number of occurrences of the given keyword
    int[] arr; // keeps page numbers of the given keyword
    ListNode result;
    int page; // holds the current page number

    result =
        ht2.chainedHashSearch(
            ht2,
            keyword); // check whether there's at least a single page with the given keyword,if the
                      // node prsent we get the first one,there can be more !!!

    if (result != null) {
      page = result.getPage();
      counter = 1; // found one occurence of the keyword

      // now let's find all the other occurrences of the same keyword
      while (result.getNext() != null) { // iterate through the whole list
        result = result.getNext();
        if (result.getKeyword().equals(keyword) && result.getPage() != page) {
          counter++;
          page = result.getPage();
        }
      }
      // now we know how many pages contain the given key word
      // let's create an array to hold all the page numbers
      arr = new int[counter];

      // let's iterate through the same linked list again to feed the array with page numbers
      counter = 0; // reset to zero again
      result = ht2.chainedHashSearch(ht2, keyword);
      arr[0] = page = result.getPage();
      counter = 1;
      while (result.getNext() != null) {

        result = result.getNext();

        if (result.getKeyword().equals(keyword) && result.getPage() != page) {
          arr[counter] = result.getPage();
          counter++;
        }
      }

      this.sort(arr);
      return arr;
    } else {
      return null;
    }
  }