Driver program
var a = [ 7 , 2 , 3 , 0 , 5 , 10 , 3 , 12 , 18 ] ; var n = a . length ; buildSparseTable ( a , n ) ; document . write ( query ( 0 , 4 ) + " " ) ; document . write ( query ( 4 , 7 ) + " " ) ; document . write ( query ( 7 , 8 ) ) ;