Find the minimum difference Iterate and find which adjacent elements have the minimum difference
for ( int i = 1 ; i < a . size ( ) ; i ++ ) { mindifference = min ( mindifference , a [ i ] - a [ i - 1 ] ) ; }