没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
///////////////////////////////////GenNode类/////////////////////////////////////////////////////////////////////
package list.glist;
public class GenNode<T> {
//1.定义成员变量
public T data; //数据域
public GenList<T> child; //地址域,指向子表
public GenNode<T> next; //地址域,指向后继结点
//2.定义构造方法
/*data指定元素
* child指向子表
* next指向后继节点
*/
public GenNode(T data, GenList<T> child, GenNode<T> next) {
this.data = data;
this.child = child;
this.next = next;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*data指定元素
* child为null
* next为null
*/
public GenNode(T data){
this(data, null,null);
}
////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
public GenNode(GenNode<T> node){
this(node.data, node.child,node.next);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*data为null
* child为null
* next为null
*/
public GenNode(){
this(null, null, null);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Override
public String toString() {
// return "GenNode [data=" + data + ", child=" + child + ", next=" + next + "]";
return child==null?data.toString():child.toString();
}
}
////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
public GenNode(GenNode<T> node){
this(node.data, node.child,node.next);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*data为null
* child为null
* next为null
*/
public GenNode(){
this(null, null, null);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Override
public String toString() {
// return "GenNode [data=" + data + ", child=" + child + ", next=" + next + "]";
return child==null?data.toString():child.toString();
}
}
剩余10页未读,继续阅读
资源评论
破晓( ̄∀ ̄)
- 粉丝: 4
- 资源: 16
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功