Standardize indent size in Data Structures challenge seeds (#38803)

* Standardize indent size in "Priority Queue" seed

* Standardize indent size in "Circular Queue" seed

* Standardize indent size

* Standardize indents "Search within a Linked List"

* Standardize indents "Remove Elements from a Linked List by Index"
This commit is contained in:
Ty Mick
2020-07-08 17:58:15 -04:00
committed by GitHub
parent ff9148ca51
commit 8656556ca2
5 changed files with 45 additions and 45 deletions

View File

@ -80,34 +80,34 @@ tests:
```js ```js
class CircularQueue { class CircularQueue {
constructor(size) { constructor(size) {
this.queue = []; this.queue = [];
this.read = 0; this.read = 0;
this.write = 0; this.write = 0;
this.max = size - 1; this.max = size - 1;
while (size > 0) { while (size > 0) {
this.queue.push(null); this.queue.push(null);
size--; size--;
} }
} }
print() { print() {
return this.queue; return this.queue;
} }
enqueue(item) { enqueue(item) {
// Only change code below this line // Only change code below this line
// Only change code above this line // Only change code above this line
} }
dequeue() { dequeue() {
// Only change code below this line // Only change code below this line
// Only change code above this line // Only change code above this line
} }
} }
``` ```

View File

@ -52,13 +52,13 @@ tests:
```js ```js
function PriorityQueue () { function PriorityQueue () {
this.collection = []; this.collection = [];
this.printCollection = function() { this.printCollection = function() {
console.log(this.collection); console.log(this.collection);
}; };
// Only change code below this line // Only change code below this line
// Only change code above this line // Only change code above this line
} }
``` ```

View File

@ -69,15 +69,15 @@ function LinkedList() {
this.add = function(element){ this.add = function(element){
var node = new Node(element); var node = new Node(element);
if(head === null){ if(head === null){
head = node; head = node;
} else { } else {
var currentNode = head; var currentNode = head;
while(currentNode.next){ while(currentNode.next){
currentNode = currentNode.next; currentNode = currentNode.next;
} }
currentNode.next = node; currentNode.next = node;
} }
length++; length++;

View File

@ -67,13 +67,13 @@ function LinkedList() {
if(head === null){ if(head === null){
head = node; head = node;
} else { } else {
var currentNode = head; var currentNode = head;
while(currentNode.next){ while(currentNode.next){
currentNode = currentNode.next; currentNode = currentNode.next;
} }
currentNode.next = node; currentNode.next = node;
} }
length++; length++;

View File

@ -74,13 +74,13 @@ function LinkedList() {
if(head === null){ if(head === null){
head = node; head = node;
} else { } else {
var currentNode = head; var currentNode = head;
while(currentNode.next){ while(currentNode.next){
currentNode = currentNode.next; currentNode = currentNode.next;
} }
currentNode.next = node; currentNode.next = node;
} }
length++; length++;
@ -90,14 +90,14 @@ function LinkedList() {
var currentNode = head; var currentNode = head;
var previousNode; var previousNode;
if(currentNode.element === element){ if(currentNode.element === element){
head = currentNode.next; head = currentNode.next;
} else { } else {
while(currentNode.element !== element) { while(currentNode.element !== element) {
previousNode = currentNode; previousNode = currentNode;
currentNode = currentNode.next; currentNode = currentNode.next;
} }
previousNode.next = currentNode.next; previousNode.next = currentNode.next;
} }
length --; length --;