R
R
rocknow2014-11-13 15:00:16
Java
rocknow, 2014-11-13 15:00:16

How to find which element has been removed in an array?

It's a simple problem, but one I couldn't answer. There is an array of ints or bytes, we delete some element in it by forming a new array without this element. The arrays are unsorted. How, given these 2 arrays, to find out which element was removed? Naturally, without enumeration, the most effective / quick solution is needed.
The task is common, but if we take the context of the language, then we take java. Maybe there are some standard methods that I did not know about.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0
0xC0CAC01A, 2014-11-13
@rocknow

Half division. O(logN)

M
mamkaololosha, 2014-11-13
@mamkaololosha

At the time of formation, remember the value or index of the deleted element

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question