Skip to content

Commit 160bdb0

Browse files
Update LinkedList.h
1 parent 4350c09 commit 160bdb0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

LinkedList.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ namespace Linked {
111111
this->erase_head();
112112
this->length = 0;
113113
}
114+
115+
Node<type>* ind(size_t i) {
116+
Node<type>* toReturn = this->head;
117+
for (; i > 0; i--)
118+
toReturn = toReturn->next;
119+
return toReturn;
120+
}
114121
};
115122
};
116123

0 commit comments

Comments
 (0)