Java
实现单链表:链表中的节点。key代表节点的值,next是指向下一个节点的指针
package com.primer.structure.single_list;
02/**
*单链表节点
* @author sd
*/
08public class Node_Single {
09public String key;//节点的值
11public Node_Single next;//指向下一个的指针
12public Node_Single(String key){//初始化head
14this.key = key;
15this.next = null;
16}
17public Node_Single(String key,Node_Single next){
18this.key = key;
19this.next = next;
20}
21 public String getKey() {