Inititalize dat [ ] array for Direct Address Table .
let i ; let dat = Array . from ( { length : n + 1 } , ( _ , i ) => 0 ) ; for ( i = 1 ; i <= n ; i ++ ) dat [ arr [ i - 1 ] ] = i ; let b = Array . from ( { length : n + 1 } , ( _ , i ) => 0 ) ; let j = 0 , c ;