Analysis of Algorithms | Big | Function to print all possible pairs ; Given array ; Store the size of the array ; Function Call
function print ( a , n ) { for ( let i = 0 ; i < n ; i ++ ) { for ( let j = 0 ; j < n ; j ++ ) { if ( i != j ) document . write ( a [ i ] + " " + a [ j ] + " " ) ; } } } let a = [ 1 , 2 , 3 ] ; let n = a . length ; print ( a , n ) ;