你哪里不会啊?把你现有的程序贴出来。

解决方案 »

  1.   

    把你的数据放到树中去,因为树本来就是有序的。
      

  2.   

    实在要说的话,也只有说说合并的时候搜索插入位置的算法了.基本上就是把一个有序链表b中的节点依次插入到另一个有序链表a的程序.由于两个链表都是有序的,当前一个节点插入后,下一个要插入的节点肯定是在此插入点之后,所以,
    可以保留前一个插入点的位置,从前一个插入点的位置往后搜索.
    其他就是一些体力活了.:)
      

  3.   

    java.util
    Interface Collection
    public boolean addAll(Collection c)
    Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.)Parameters:c - elements to be inserted into this collection.Returns:true if this collection changed as a result of the callThrows:UnsupportedOperationException - if this collection does not support the addAll method.
    ClassCastException - if the class of an element of the specified collection prevents it from being added to this collection.
    NullPointerException - if the specified collection contains one or more null elements and this collection does not support null elements, or if the specified collection is null.IllegalArgumentException - some aspect of an element of the specified collection prevents it from being added to this collection.参考这个方法试试看