English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

If every node and data within the stack or queue or list can handling deep cloning then duplicating such ADT needs no more than adt_obj.clone()

But being able to handle deep cloning is not default in Java, if that is true clone() will do very little called shallow copying, that would not duplicate and your only choice is read in and reconstruct every object with a copying procedure.

2007-03-20 16:43:18 · answer #1 · answered by Andy T 7 · 0 0

modify clone function to allow deep copying and use it

2007-03-21 00:49:29 · answer #2 · answered by Anonymous · 0 1

fedest.com, questions and answers