Data Structure and Algorithms
文章平均质量分 61
小安-自强不息
这个作者很懒,什么都没留下…
展开
-
Linkedlist和Array实现Stack
LinkedList实现Stack public Class Stack{ private Node first = null; private class Node{ Item item; Node next; } public boolean isEmpty(){ return first == null; } public void push(Item i原创 2014-02-18 08:02:04 · 541 阅读 · 0 评论 -
各种sorting总结
Selection sort: 1. Divide the input into two part: sublist of items already sorted and sublist of items to be sorted. 2. Find the smallest element in unsorted sublist, exchange it with the leftmos原创 2014-02-18 09:09:22 · 728 阅读 · 0 评论 -
Linkedlist实现Queue
public class Queue{ private Node first; private Node last; private class Node{ Item item; Node next; } public boolean isEmpty(){ return first == null; } public void enqueue(Item item){原创 2014-02-18 08:10:27 · 447 阅读 · 0 评论