## 4 TKIFRPM Approach
### Update ISI-Tables  
The ISI-tables are updated using the \"update_ISI_tables\" algorithm as shown in Algorithm 2. The algorithm receives the following three parameters: _ISI-tables_, transaction buffer \(T_{b}\), and _flag_. The _ISI-tables_ are updated with the transactions received in the transaction buffer \(T_{b}\). Each transaction in the \(T_{b}\) is scanned, and for every item in a selected transaction from \(T_{b}\), the corresponding row in the support table is adjusted. Every item in the selected transaction is hashed and stored in the items table to find the address of the corresponding row \((f_{1}-ptr)\) in the support table. The address of an item is used to update the support, Updt-bit, and TID fields in the support table. At the end, the value of the _flag_ is checked. If it is 1, the support table is sorted in descending support order using a merge-sort. The _flag_ value 1 indicates that the _ISI-tables_ are populated for the first time, and the _flag_ value 0 occurs every time the transaction buffer is copied to the _ISI-tables_, and that updation of the _ISI-tables_ is needed. The _ISI-tables_ maintain items in the support descending order using a binary search. The items with their support values are searched in the support table using a binary search to find the suitable place for its adjustment. This way, _ISI-tables_ maintain the order of the items without performing sorting operations on all items in a dataset.  
```
Input: \(ISI-tables:-ItemsSupportIndexTables\) \(T_{b}:-transactionbuffer\) \(flag-to\) performMergeSort or binary search (1) foreach\(tr\in T_{b}\) (2) foreach\(item\in t_{r}\) (3) \(f_{1}-ptr\) = ISI - tables.items'table[item] (4) \(\text{ISI}-\text{tables.Support'table}[f_{1}-ptr].\text{Support}++\) (5) \(\text{ISI}-\text{tables.Support'table}[f_{1}-ptr].\text{Updt\_bit}\gets 1\) (6) \(\text{ISI}-\text{tables.Support'table}[f_{1}-ptr].\text{id}\cup\text{tr.tid}\) (7) If (flag=1) (8) Merge-sort (ISI-tables) // to sort the support table in descending order of the support (9) else (10) Binary-search (ISI-tables) // to place the updated items in their correct order in support table (11) Return
```  
**Algorithm 2** update_ISI_tables (ISI-tables, \(T_{b}\), flag)  
The \"select-K-itemset\" algorithm shown in Algorithm 3 copies a 1-itemset from the ISI-tables. The ISI- tables may contain more than one 1-itemset with a similar support. The similar support of all these are treated as distinct and selected if their support is above or  
Figure 2: Structure of ISI-tables.  
equal to the \(k\)th topmost support. This procedure considers three parameters, as follows: _ISI-tables_, \(K\), and \(C_{l}\). The \"select-K-itemset\" algorithm counts the unique support of items in _ISI-tables_ and select the corresponding items until the total number of unique supports is equal to \(K\).  
```
Input: \(\cup_{spt}\leftarrow\)unique support \(prev-spt\gets previous\) (1) \(i\gets 1\), \(\cup_{spt}\gets 0\), \(K\gets 1\), \(C_{l}\leftarrow\varnothing\) (2) New item (3) \(item.id\gets ISI-tables.support\)\(\cdot\)table.item\(\_id[i]\) (4) \(item.id\gets ISI-tables.support\)\(\cdot\)table.tid\([i]\) (5) \(C_{l}\leftarrow\)\(C_{l}\cup\)item (6) \(prev-spt\gets support\)\((item.tid)\) (7) repeatUntil\(\cup_{spt}<=k\) (8) \(i++\) (9) New item (10) \(item.id\gets ISI-tables.item-id[i]\) (11) \(item.id\gets ISI-tables.support\)\(\cdot\)table.item \(-tid[i]\) (12) \(C_{l}\leftarrow\)\(C_{l}\cup\)item (13) \(if\)\((prev-spt\)\(!=support(item.tid))\) (14) \(\cup_{spt}++\) (15) \(pro-spt\gets support(item.tid)\) (16) \(if\)\((\cup_{spt}\geq k)\) (17) break (18) Return \(C_{l}\)
```  
**Algorithm 3**\(select\_K\_item\) (_ISI-tables_, \(K\), \(C_{l}\)_)