队列
Vector
链表
ArrayList
java.util.*下面一堆这样的数据结构
Stack
Hashtable
Collection
都有
看java的api就好了

解决方案 »

  1.   

    楼上说得对,可以先看看Vector类,那是一个不坏的链表类。
      

  2.   

    建议,看Thinking in java (III)!
    stack:如下
    import com.bruceeckel.simpletest.*;
    import java.util.*;
    import com.bruceeckel.util.*;public class StackL {
      private LinkedList list = new LinkedList();
      public void push(Object v) {
        list.addFirst(v);
      }
      public Object top() { return list.getFirst(); }
      public Object pop() { 
        return list.removeFirst(); 
      }
      public static void main(String[] args) {
        SimpleTest monitor =
          new SimpleTest("StackL");
        StackL stack = new StackL();
        for(int i = 0; i < 10; i++)
          stack.push(Collections2.countries.next());
        System.out.println(stack.top());
        System.out.println(stack.top());
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        monitor.expect(new String[] {
          "CHAD",
          "CHAD",
          "CHAD",
          "CENTRAL AFRICAN REPUBLIC",
          "CAPE VERDE"
        });
      }
    } ///:~
      

  3.   

    那我能不能自己写这些结构呢?
    JAVA没有指针好像对处理这些动态结构的能力就要差一点了。请各位大侠给我推荐几本这方面的书好吗?
      

  4.   

    清华有本数据结构,是java版的,写的还行,例字也很容易看..推荐..
      

  5.   

    Java 2编程指南,这本书比较好(对初学者),他把java里面的数据结构讲的比较清楚(包括实现链表等)。
      

  6.   

    一个结点和链表类
    import java.awt.*;
    import java.applet.*;
    class Node
    {
    private int Data;
    private  Node Next;
    public Node(int x)
    {
    Data=x;
    Next=null;
    }
    public Node(int x,Node next)
    {
    Data=x;
    Next=next;
    }
    public void setData(int x)
    {
    Data=x;
    }
     public int getData()
    {
    return Data;
    }
         public void  setNext(Node NewNode)
    {
    Next=NewNode;

    }
     public Node getNext()
    {
    return Next;
    }


    } class List
    {
    private Node FirstNode;
    public List()
    {
    FirstNode=null;
    }
    public List(int data)
    {
    FirstNode=new Node(data);
    }
    //±é&Agrave;ú
    public String visitAll()
    {
    Node head=FirstNode;
    String str="";
    if(head==null)
    return str;
    else
    do
    {
    str+=head.getData()+";";
    }
    while((head=head.getNext())!=null);
    return str;
    }
    public void insertAtBegin(int data)
    {
    if(FirstNode==null)
    FirstNode=new Node(data);
    else
    FirstNode=new Node(data,FirstNode);
    }
    public void addAtEnd(int data)
    {
    Node head=FirstNode;
    if(FirstNode!=null)
    {
    while(head.getNext()!=null)
    {
    head=head.getNext();
    }
    head.setNext(new Node(data));
    }
    else
    FirstNode=new Node(data);
    }
    //delete the first node whose data is id
    public boolean removeAtId(int id)
    {
    Node head=FirstNode;
    Node fellow;
    if(head==null)
    System.out.println("The list is empty!");
    else
    {
    while(head.getData()!=id)
    {
    fellow=head;
    head=head.getNext();
    }
    }
    if(head==null)
    return false;
    else
    {
    //fellow.setNext(head.getNext());
    return true;
    }
    }
    public void removeAll()
    {
    FirstNode=null;
    }
    }
      

  7.   

    当然可以自己写啦。
    如:实现队列
    interface Queue{
        void add(Object obj);
        Object remove();
        int size();
    }
    class LinkedListQueue implements Queue{
        LinkedListQueue(){...}
        public void add(Object obj){...}
        public Object remove(){...}
        public int size(){...}    private Link head;
        private Link tail;
    }