- 2024-04-23双向循环链表
小白感觉双向链表和单向链表的区别并不大,就是地址的交接有点繁琐,需要清晰的逻辑,简单理解就是俩条平行线,无线延伸,但是俩个线不交叉,但都是在一张纸上开始延展,头结点就像这张纸,理解的可能有点抽象,但我感觉这就是个抽象的概念,所以特编写初级的代码如下:/*****************************
- 2023-09-07LRUCache算法缓存策略(map+doubleLinkedList)
packagearithmetic;importjava.util.HashMap;publicclassFaceTest81{//LRUcache缓存策略map+双向链表//get、update、put需要时间复杂度达到O1//map+双向链表结构publicFaceTest81(intcapacity){ cache=newMyCache(capacity);}privateMyCache<Integer,Intege
- 2023-01-11双链表
图示: 代码: 1importlombok.Data;23publicclassDoubleLinkedListTest{4publicstaticvoidmain(String[]args){5Doubl
- 2022-11-10Python: DoubleLinkedList
importtypingclassNode:def__init__(self,value):self.value=valueself.prev=Noneself.next=Nonedef__repr__(s
- 2022-10-30C++ DoubleLinkedList
C++DoubleLinkedListForthisassignment,createaclassthatrepresentsadoublelinkedlist(forwardandbackwardnavigation),calledDoubleLinkedList,ofin