mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-12-08 19:06:00 +00:00
Code style fixes.
This commit is contained in:
parent
de1cc0b047
commit
e220450d7d
@ -7,7 +7,7 @@ The task is to traverse the given linked list in straight order.
|
||||
|
||||
For example for the following linked list:
|
||||
|
||||

|
||||

|
||||
|
||||
The order of traversal should be:
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
Например, для следующего связного списка:
|
||||
|
||||

|
||||

|
||||
|
||||
Порядок обхода будет такой:
|
||||
|
||||
|
||||
@ -227,20 +227,18 @@ describe('LinkedList', () => {
|
||||
let node = linkedList.find({ value: 3 });
|
||||
expect(node.value).toBe(4);
|
||||
|
||||
node = linkedList.find({ callback: value => value < 3 });
|
||||
node = linkedList.find({ callback: (value) => value < 3 });
|
||||
expect(node.value).toBe(1);
|
||||
});
|
||||
|
||||
it('should convert to array', () => {
|
||||
const linkedList = new LinkedList();
|
||||
|
||||
linkedList.append(1);
|
||||
linkedList.append(2);
|
||||
linkedList.append(3);
|
||||
|
||||
expect(linkedList.toArray().join(',')).toBe('1,2,3');
|
||||
});
|
||||
|
||||
|
||||
it('should reverse linked list', () => {
|
||||
const linkedList = new LinkedList();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user