Sort the intervals based on velocity
Array . Sort ( test , new sortHelper ( ) ) ; for ( int i = 0 ; i < N ; i ++ ) { int [ ] count = new int [ MAX ] ; int current_velocity = test [ i ] . v ; int j = i ;