Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9e07a94

Browse files
Merge pull request #52 from Mk996/master
return list instead of console.log
2 parents fc1f466 + dbfe9f1 commit 9e07a94

File tree

1 file changed

+3
-1
lines changed
  • src/_DataStructures_/DoublyLinkedList

1 file changed

+3
-1
lines changed

‎src/_DataStructures_/DoublyLinkedList/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ class DoublyLinkedList {
5555

5656
display() {
5757
let address = this.head.next;
58+
let addresses = []
5859
while (address !== this.tail) {
59-
console.log(address.data);
60+
addresses.push(address.data)
6061
address = address.next;
6162
}
63+
return addresses
6264
}
6365
}
6466

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /