Delete element using search in sorted array