File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,16 @@ class HashTable {
47
47
}
48
48
return keys ;
49
49
} ;
50
-
51
- values = ( ) => {
50
+
51
+ values = ( ) => {
52
52
const values = [ ] ;
53
53
for ( let i = 0 ; i < this . table . length ; i ++ ) {
54
- if ( this . table [ i ] ) {
55
- values . push ( this . table [ i ] [ 0 ] [ 1 ] ) ;
56
- }
54
+ if ( this . table [ i ] ) {
55
+ values . push ( this . table [ i ] [ 0 ] [ 1 ] ) ;
56
+ }
57
57
}
58
58
return values ;
59
- } ;
59
+ } ;
60
60
}
61
61
62
62
// Test
Original file line number Diff line number Diff line change @@ -57,18 +57,19 @@ class LinkedList {
57
57
58
58
find ( value ) {
59
59
const elements = this . print ( ) ;
60
- return elements . find ( ( element ) => element . value . toLowerCase ( ) === value . toLowerCase ( ) ) ;
60
+ return elements . find (
61
+ ( element ) => element . value . toLowerCase ( ) === value . toLowerCase ( )
62
+ ) ;
61
63
}
62
64
63
65
insertAfter ( value , afterValue ) {
64
66
const existingNode = this . find ( afterValue ) ;
65
67
if ( existingNode ) {
66
68
const newNode = { value, next : existingNode . next } ;
67
69
existingNode . next = newNode ;
68
- }
70
+ }
69
71
}
70
72
71
-
72
73
insertAtTail ( value ) {
73
74
const newNode = { value, next : null } ;
74
75
if ( ! this . head ) {
You can’t perform that action at this time.
0 commit comments