Code style fixes.

This commit is contained in:
Oleksii Trekhleb 2020-12-17 09:49:57 +01:00
parent de1cc0b047
commit e220450d7d
3 changed files with 4 additions and 6 deletions

View File

@ -7,7 +7,7 @@ The task is to traverse the given linked list in straight order.
For example for the following linked list: For example for the following linked list:
![](https://upload.wikimedia.org/wikipedia/commons/6/6d/Singly-linked-list.svg) ![Singly linked list](https://upload.wikimedia.org/wikipedia/commons/6/6d/Singly-linked-list.svg)
The order of traversal should be: The order of traversal should be:

View File

@ -4,7 +4,7 @@
Например, для следующего связного списка: Например, для следующего связного списка:
![](https://upload.wikimedia.org/wikipedia/commons/6/6d/Singly-linked-list.svg) ![Singly linked list](https://upload.wikimedia.org/wikipedia/commons/6/6d/Singly-linked-list.svg)
Порядок обхода будет такой: Порядок обхода будет такой:

View File

@ -227,20 +227,18 @@ describe('LinkedList', () => {
let node = linkedList.find({ value: 3 }); let node = linkedList.find({ value: 3 });
expect(node.value).toBe(4); expect(node.value).toBe(4);
node = linkedList.find({ callback: value => value < 3 }); node = linkedList.find({ callback: (value) => value < 3 });
expect(node.value).toBe(1); expect(node.value).toBe(1);
}); });
it('should convert to array', () => { it('should convert to array', () => {
const linkedList = new LinkedList(); const linkedList = new LinkedList();
linkedList.append(1); linkedList.append(1);
linkedList.append(2); linkedList.append(2);
linkedList.append(3); linkedList.append(3);
expect(linkedList.toArray().join(',')).toBe('1,2,3'); expect(linkedList.toArray().join(',')).toBe('1,2,3');
}); });
it('should reverse linked list', () => { it('should reverse linked list', () => {
const linkedList = new LinkedList(); const linkedList = new LinkedList();