Java Reference
In-Depth Information
If array
A
contains 1, 13, 24, 26 and
B
contains 2, 15, 27, 38, the algorithm
proceeds as follows. First, a comparison is made between 1 and 2, 1 is added
to
C,
and 13 and 2 are compared:
1
13
24
26
2
15
27
38
1
Actr
Bctr
Cctr
Then 2 is added to
C,
and 13 and 15 are compared:
1
13
24
26
2
15
27
38
12
Actr
Bctr
Cctr
Next, 13 is added to
C,
and 24 and 15 are compared:
1
13
24
26
2
15
27
38
12 3
Actr
Bctr
Cctr
The process continues until 26 and 27 are compared:
1
13
24
26
2
15
27
38
1
2
13
15
Actr
Bctr
Cctr
1
13
24
26
2
15
27
38
1
2
13
15
24
Actr
Bctr
Cctr
Then 26 is added to
C
, and the
A
array is exhausted:
1
13
24
26
2
15
27
38
1
2
13
15
24
26
Actr
Bctr
Cctr
Search WWH ::
Custom Search