⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node-node.html

📁 经典的数据结构源代码(java 实现)
💻 HTML
字号:
<html><head><title>Code Fragment</title></head><body text=#000000><center></center><br><br><dl><dd><pre><font color = #ff0080>/** Node of a singly linked list of strings. */</font><font color=#8000a0>public</font> <font color=#8000a0><font color=#ff8000>class</font> </font>Node {  <font color=#8000a0><font color=#8000a0>private</font> </font><font color=#8000a0>String</font> element;	<font color=#ff0080>// we assume elements are character strings</font>  <font color=#8000a0><font color=#8000a0>private</font> </font>Node next;  <font color = #ff0080>/** Creates a node with the given element and next node. */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font><font color=#0000ff>Node</font>(<font color=#8000a0>String</font> s, <font color=#8000a0>Node </font>n) {    element = s;    next = n;  }  <font color = #ff0080>/** Returns the element of this node. */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font><font color=#8000a0>String</font> <font color=#0000ff>getElement</font>() { <font color=#8000a0><font color=#ff8000>return</font> </font>element; }  <font color = #ff0080>/** Returns the next node of this node. */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font>Node <font color=#0000ff>getNext</font>() { <font color=#8000a0><font color=#ff8000>return</font> </font>next; }  <font color=#ff0080>// Modifier methods:</font>  <font color = #ff0080>/** Sets the element of this node. */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font><font color=#8000a0>void</font> <font color=#0000ff>setElement</font>(<font color=#8000a0>String</font> newElem) { element = newElem; }  <font color = #ff0080>/** Sets the next node of this node. */</font>  <font color=#8000a0><font color=#8000a0>public</font> </font><font color=#8000a0>void</font> <font color=#0000ff>setNext</font>(Node newNext) { next = newNext; }}</dl></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -