Skip to content

Commit

Permalink
Merge pull request #15 from hilihan/master
Browse files Browse the repository at this point in the history
作业提交
  • Loading branch information
gaodekui authored Feb 26, 2017
2 parents a478b9f + ebd5820 commit 91ea466
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
Binary file not shown.
67 changes: 67 additions & 0 deletions group16/502059278/src/cn/mark/MyLinkedList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package cn.mark;
/**
* 自定义实现LinkedList数据结构
* @author hilih
*
*/
public class MyLinkedList implements MyList{

private Node head;
private int size;//集合的长度

/**
* 添加元素
*/
@Override
public boolean add(Object o) {
//为空判断
if ( o == null ){
System.out.println("不允许null的元素插入!");
return false;
}
if(head == null){
head = new Node();
head.data = o;
}else{

}

return false;
}

@Override
public boolean add(int index, Object o) {
// TODO Auto-generated method stub
return false;
}

@Override
public Object get(int index) {
// TODO Auto-generated method stub
return null;
}

@Override
public Object remove(int index) {
// TODO Auto-generated method stub
return null;
}

@Override
public int size() {
// TODO Auto-generated method stub
return 0;
}

private static class Node{
Object data;
Node next;
}


public static void main(String[] args) {


}

}

0 comments on commit 91ea466

Please sign in to comment.