📄 nodedeque-nodedeque.html
字号:
<html><head><title>Code Fragment</title></head><body text=#000000><center></center><br><br><dl><dd><pre><font color=#8000a0>public</font> <font color=#8000a0><font color=#ff8000>class</font> </font>NodeDeque<E> <font color=#8000a0><font color=#ff8000>implements</font> </font>Deque<E> { <font color=#8000a0><font color=#8000a0>protected</font> </font>DLNode<E> header, trailer; <font color=#ff0080>// sentinels</font> <font color=#8000a0><font color=#8000a0>protected</font> </font><font color=#8000a0>int</font> size; <font color=#ff0080>// number of elements</font> <font color=#8000a0><font color=#8000a0>public</font> </font><font color=#0000ff>NodeDeque</font>() { <font color=#ff0080>// initialize an empty deque</font> header = <font color=#8000a0><font color=#ff8000>new</font> </font>DLNode<E><font color=#0000ff></font>(); trailer = <font color=#8000a0><font color=#ff8000>new</font> </font>DLNode<E><font color=#0000ff></font>(); header.<font color=#0000ff>setNext</font>(trailer); <font color=#ff0080>// make header point to trailer</font> trailer.<font color=#0000ff>setPrev</font>(header); <font color=#ff0080>// make trailer point to header</font> size = 0; }</dl></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -