fixed find implementation
This commit is contained in:
parent
21325cff77
commit
ffa48c45b0
1 changed files with 2 additions and 2 deletions
|
|
@ -88,12 +88,12 @@ export const LinkedList = () => {
|
|||
for (let i = 0; i < CLU.totalNodes; i++) {
|
||||
// if node value matches, set to true
|
||||
if (MCP.currentNode.value === value) {
|
||||
bool = true;
|
||||
return i;
|
||||
}
|
||||
// otherwise set to next node
|
||||
MCP.currentNode = MCP.currentNode.nextNode;
|
||||
}
|
||||
return bool;
|
||||
return null;
|
||||
}
|
||||
// print Nodes out and preview them in the console
|
||||
const toString = () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue