Skip to content

Commit

Permalink
updated printing format
Browse files Browse the repository at this point in the history
  • Loading branch information
Abid Khan committed Nov 16, 2022
1 parent 20c5ea2 commit ca97283
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions linkedlists/linkedLists.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function LinkedList(){
current = current.next
}

console.log(output.toString())
console.log(output.join("->"))
};

this.print = function(){
Expand All @@ -125,7 +125,8 @@ function LinkedList(){
current = current.next
}

console.log(output.toString())
console.log(output.join("->"))
return
};

this.getHead = function (){
Expand All @@ -134,27 +135,28 @@ function LinkedList(){
}

const ll = new LinkedList();



ll.append(6);
ll.append(5);
ll.append(7);
ll.append(8);
ll.append(2);
ll.append(4);
ll.append(16);
ll.append(25);
ll.append(47);
ll.append(85);
ll.append(25);
ll.append(34);
ll.print()
// ll.removeAt()
// ll.remove()
// ll.remove()
ll.remove(47)
// ll.insert(11, 1000)
ll.print()

console.log(ll.getHead());
module.exports = ll;



// ll.append(6);
// ll.append(5);
// ll.append(7);
// ll.append(8);
// ll.append(2);
// ll.append(4);
// ll.append(16);
// ll.append(25);
// ll.append(47);
// ll.append(85);
// ll.append(25);
// ll.append(34);
// ll.print()
// // ll.removeAt()
// // ll.remove()
// // ll.remove()
// ll.remove(47)
// // ll.insert(11, 1000)
// ll.print()

// console.log(ll.getHead());

0 comments on commit ca97283

Please sign in to comment.