Skip to content

2017编程提高社群作业:实现基本的数据结构(2017.2.19)#3

Closed
ikook-wang wants to merge 46 commits intoonlyliuxin:masterfrom
ikook-wang:master
Closed

2017编程提高社群作业:实现基本的数据结构(2017.2.19)#3
ikook-wang wants to merge 46 commits intoonlyliuxin:masterfrom
ikook-wang:master

Conversation

@ikook-wang
Copy link
Contributor

  1. 实现了ArrayList、LinkedList、Queue(依靠LinkedList实现)、Stack(依靠ArrayList实现)
    1.1 ArrayList实现了一下方法:
    (1)add(Object): 添加元素到集合;
    (2)add(int, Object): 添加元素到集合的指定位置;
    (3)size(): 返回集合的大小,类型为 int;
    (4)isEmpty(): 判断集合是否为空,类型为 boolean;
    (5)get(int): 获取集合指定位置的元素;
    (6)remove(int): 删除指定位置的对象;
    (7)remove(Object): 删除指定的对象;
    (8)set(int, Object): 更改集合中指定位置的元素,并返回原来的对象;
    (9)iterator(): 返回一个迭代器的实现类。
    1.2 LinkedList实现了一下方法:
    (1)addFirst(Object): 在链表头部插入新的元素;
    (2)addLast(Object): 在链表尾部插入新的元素;
    (3)add(Object): 在链表中插入新的元素;
    (4)add(int, Object): 在链表指定位置插入新的元素;
    (5)size(): 返回链表的大小,类型为 int;
    (6)isEmpty(): 判断链表是否为空,类型为 boolean;
    (7)getFirst(): 获取链表头部的元素;
    (8)getLast(): 获取链表尾部的元素;
    (9)get(int): 获取链表指定位置的元素;
    (10)set(int, Object): 更改链表中指定位置的元素,并返回原来的对象。
    (11)removeFirst(): 删除链表头部的元素;
    (12)removeLast(int): 删除链表尾部的元素;
    (13)remove(Object): 删除指定元素;
    (14)remove(int): 删除指定位置的元素;
    (15)iterator(): 返回一个迭代器的实现类。
    1.3 Queue实现了一下方法:
    (1)enQueue(Object): 入队操作;
    (2)deQueue(): 出队操作;
    (3)size(): 返回队列的长度;
    (4)isEmpty(): 判断队列是否为空。
    1.4 Stack实现了一下方法:
    (1)push(Object):入栈操作;
    (2)pop():出栈操作;
    (3)getTop():获取栈顶元素;
    (4)isEmpty():判断栈是否为空;
    (5)size():获取栈的深度。

  2. 实现了BinarySearchTree、Iterator接口
    2.1 BinarySearchTree实现了一下方法:
    (1)insert(int):插入操作;
    (2)find(int):查找操作;
    (3)delete(int):删除操作;
    (4)inorderTraverse(Node):遍历操作,采用中序遍历。
    2.2 Iterator定义了一下方法:
    (1)hasNext():判断是否有元素没有被遍历;
    (2)next():返回游标当前位置的元素并将游标移动到下一个位置;
    (3)remove():删除游标左边的元素,在执行完 next 之后该操作只能执行一次。

  3. 对应以上类做了单元测试
    说明:由于作业以实现基本的数据结构为主,则在实现单元测试时,只对正常情况进行了测试,一些异常情况并进行编写测试用例。

onlyliuxin pushed a commit that referenced this pull request Mar 13, 2017
onlyliuxin pushed a commit that referenced this pull request Mar 13, 2017
onlyliuxin pushed a commit that referenced this pull request Mar 13, 2017
把组长的代码和到我自己的仓库里面来
onlyliuxin pushed a commit that referenced this pull request Mar 15, 2017
第三周作业,,大连-书生
onlyliuxin pushed a commit that referenced this pull request Mar 26, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 3, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 3, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 5, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 6, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 6, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 9, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 9, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 9, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 17, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 17, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 27, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 27, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 27, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 27, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 27, 2017
onlyliuxin pushed a commit that referenced this pull request Apr 27, 2017
onlyliuxin pushed a commit that referenced this pull request May 12, 2017
onlyliuxin pushed a commit that referenced this pull request May 12, 2017
onlyliuxin pushed a commit that referenced this pull request Jun 1, 2017
onlyliuxin pushed a commit that referenced this pull request Jun 19, 2017
onlyliuxin pushed a commit that referenced this pull request Jul 10, 2017
新建knowledge-point目录
onlyliuxin pushed a commit that referenced this pull request Jul 12, 2017
onlyliuxin pushed a commit that referenced this pull request Jul 25, 2017
2017年6月25日 18:07:39 合并
onlyliuxin pushed a commit that referenced this pull request Jul 25, 2017
onlyliuxin pushed a commit that referenced this pull request Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants