added try_merge_with_adjacent_segements function to merge for buddy system