Skip to content

removed unused variable in Doubly linked list and amended insert method #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chapter05/03-DoublyLinkedList2.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let DoublyLinkedList2 = (function () {
append(element) {

let node = new Node(element),
current, _tail;
_tail;

if (this.getHead() === null) { //first node on list
head.set(this, node);
Expand Down Expand Up @@ -54,7 +54,7 @@ let DoublyLinkedList2 = (function () {

if (position === 0) { //add on first position

if (!this.getHead()) { //NEW
if (!current) { //NEW
head.set(this, node);
tail.set(this, node);
} else {
Expand Down
6 changes: 3 additions & 3 deletions chapter06/01-Set2.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let Set2 = (function () {
}

union(otherSet){
let unionSet = new Set();
let unionSet = new Set2();

let values = this.values();
for (let i=0; i<values.length; i++){
Expand All @@ -71,7 +71,7 @@ let Set2 = (function () {
}

intersection(otherSet){
let intersectionSet = new Set();
let intersectionSet = new Set2();

let values = this.values();
for (let i=0; i<values.length; i++){
Expand All @@ -84,7 +84,7 @@ let Set2 = (function () {
}

difference(otherSet){
let differenceSet = new Set();
let differenceSet = new Set2();

let values = this.values();
for (let i=0; i<values.length; i++){
Expand Down