public boolean insert ( Object new1 ) { boolean result ; InsertStack stack = getInsertStack ( ) ; if ( root ( ) == null ) pessimisticInsert ( stack , new1 ) ; else { boolean didit = optimisticInsert ( stack , new1 ) ; if ( didit == pessimisticNeeded ) pessimisticInsert ( stack , new1 ) ; } if ( stack . isDuplicate ( ) ) result = false ; else result = true ; return result ; }
Insert into a GBS Tree .