Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 531 Bytes

Ex_1_2_08.md

File metadata and controls

26 lines (16 loc) · 531 Bytes
title date draft tags categories
算法4 Java解答 1.2.08
2019-02-22 07:35:22 +0800
false
JAVA
技术
归档

1.2.08

问题:

Suppose that a[] and b[] are each integer arrays consisting of millions of inte- gers. What does the follow code do? Is it reasonably efficient? int[] t = a; a = b; b = t;

Answer. It swaps them. It could hardly be more efficient because it does so by copying references, so that it is not necessary to copy millions of elements.

分析:

参考: