diff --git a/docs/en/UI/Common/Utils/Linked-List.md b/docs/en/UI/Common/Utils/Linked-List.md index bee8b27029..c700520bab 100644 --- a/docs/en/UI/Common/Utils/Linked-List.md +++ b/docs/en/UI/Common/Utils/Linked-List.md @@ -42,7 +42,7 @@ There are several methods to create new nodes in a linked list and all of them a #### addHead(value) ```js -addHead(value: T): ListNode\ +addHead(value: T): ListNode ``` Adds a node with given value as the first node in list: @@ -66,7 +66,7 @@ list.addHead('c'); #### addManyHead(values) ```js -addManyHead(values: T\[\]): ListNode\\[\] +addManyHead(values: T[]): ListNode[] ``` Adds multiple nodes with given values as the first nodes in list: @@ -86,7 +86,7 @@ list.addManyHead(['x', 'y', 'z']); #### addTail(value) ```js -addTail(value: T): ListNode\ +addTail(value: T): ListNode ``` Adds a node with given value as the last node in list: @@ -110,7 +110,7 @@ list.addTail('c'); #### addManyTail(values) ```js -addManyTail(values: T\[\]): ListNode\\[\] +addManyTail(values: T[]): ListNode[] ``` Adds multiple nodes with given values as the last nodes in list: @@ -130,7 +130,7 @@ list.addManyTail(['x', 'y', 'z']); #### addAfter(value, previousValue, compareFn) ```js -addAfter(value: T, previousValue: T, compareFn = compare): ListNode\ +addAfter(value: T, previousValue: T, compareFn = compare): ListNode ``` Adds a node with given value after the first node that has the previous value: @@ -177,7 +177,7 @@ list.addAfter( #### addManyAfter(values, previousValue, compareFn) ```js -addManyAfter(values: T\[\], previousValue: T, compareFn = compare): ListNode\\[\] +addManyAfter(values: T[], previousValue: T, compareFn = compare): ListNode[] ``` Adds multiple nodes with given values after the first node that has the previous value: @@ -219,7 +219,7 @@ list.addManyAfter( #### addBefore(value, nextValue, compareFn) ```js -addBefore(value: T, nextValue: T, compareFn = compare): ListNode\ +addBefore(value: T, nextValue: T, compareFn = compare): ListNode ``` Adds a node with given value before the first node that has the next value: @@ -266,7 +266,7 @@ list.addBefore( #### addManyBefore(values, nextValue, compareFn) ```js -addManyBefore(values: T\[\], nextValue: T, compareFn = compare): ListNode\\[\] +addManyBefore(values: T[], nextValue: T, compareFn = compare): ListNode[] ``` Adds multiple nodes with given values before the first node that has the next value: @@ -308,7 +308,7 @@ list.addManyBefore( #### addByIndex(value, position) ```js -addByIndex(value: T, position: number): ListNode\ +addByIndex(value: T, position: number): ListNode ``` Adds a node with given value at the specified position in the list: @@ -346,7 +346,7 @@ list.addByIndex('x', -1); #### addManyByIndex(values, position) ```js -addManyByIndex(values: T\[\], position: number): ListNode\\[\] +addManyByIndex(values: T[], position: number): ListNode[] ``` Adds multiple nodes with given values at the specified position in the list: @@ -380,7 +380,7 @@ list.addManyByIndex(['x', 'y'], -1); #### add(value).head() ```js -add(value: T).head(): ListNode\ +add(value: T).head(): ListNode ``` Adds a node with given value as the first node in list: @@ -408,7 +408,7 @@ list.add('c').head(); #### add(value).tail() ```js -add(value: T).tail(): ListNode\ +add(value: T).tail(): ListNode ``` Adds a node with given value as the last node in list: @@ -436,7 +436,7 @@ list.add('c').tail(); #### add(value).after(previousValue, compareFn) ```js -add(value: T).after(previousValue: T, compareFn = compare): ListNode\ +add(value: T).after(previousValue: T, compareFn = compare): ListNode ``` Adds a node with given value after the first node that has the previous value: @@ -483,7 +483,7 @@ list #### add(value).before(nextValue, compareFn) ```js -add(value: T).before(nextValue: T, compareFn = compare): ListNode\ +add(value: T).before(nextValue: T, compareFn = compare): ListNode ``` Adds a node with given value before the first node that has the next value: @@ -530,7 +530,7 @@ list #### add(value).byIndex(position) ```js -add(value: T).byIndex(position: number): ListNode\ +add(value: T).byIndex(position: number): ListNode ``` Adds a node with given value at the specified position in the list: @@ -572,7 +572,7 @@ list.add('x').byIndex(-1); #### addMany(values).head() ```js -addMany(values: T\[\]).head(): ListNode\\[\] +addMany(values: T[]).head(): ListNode[] ``` Adds multiple nodes with given values as the first nodes in list: @@ -596,7 +596,7 @@ list.addMany(['x', 'y', 'z']).head(); #### addMany(values).tail() ```js -addMany(values: T\[\]).tail(): ListNode\\[\] +addMany(values: T[]).tail(): ListNode[] ``` Adds multiple nodes with given values as the last nodes in list: @@ -620,7 +620,7 @@ list.addMany(['x', 'y', 'z']).tail(); #### addMany(values).after(previousValue, compareFn) ```js -addMany(values: T\[\]).after(previousValue: T, compareFn = compare): ListNode\\[\] +addMany(values: T[]).after(previousValue: T, compareFn = compare): ListNode[] ``` Adds multiple nodes with given values after the first node that has the previous value: @@ -662,7 +662,7 @@ list #### addMany(values).before(nextValue, compareFn) ```js -addMany(values: T\[\]).before(nextValue: T, compareFn = compare): ListNode\\[\] +addMany(values: T[]).before(nextValue: T, compareFn = compare): ListNode[] ``` Adds multiple nodes with given values before the first node that has the next value: @@ -704,7 +704,7 @@ list #### addMany(values).byIndex(position) ```js -addMany(values: T\[\]).byIndex(position: number): ListNode\\[\] +addMany(values: T[]).byIndex(position: number): ListNode[] ``` Adds multiple nodes with given values at the specified position in the list: @@ -748,7 +748,7 @@ There are a few methods to remove nodes from a linked list and all of them are s #### dropHead() ```js -dropHead(): ListNode\ | undefined +dropHead(): ListNode | undefined ``` Removes the first node from the list: @@ -768,7 +768,7 @@ list.dropHead(); #### dropManyHead(count) ```js -dropManyHead(count: number): ListNode\\[\] +dropManyHead(count: number): ListNode[] ``` Removes the first nodes from the list based on given count: @@ -788,7 +788,7 @@ list.dropManyHead(2); #### dropTail() ```js -dropTail(): ListNode\ | undefined +dropTail(): ListNode | undefined ``` Removes the last node from the list: @@ -808,7 +808,7 @@ list.dropTail(); #### dropManyTail(count) ```js -dropManyTail(count: number): ListNode\\[\] +dropManyTail(count: number): ListNode[] ``` Removes the last nodes from the list based on given count: @@ -828,7 +828,7 @@ list.dropManyTail(2); #### dropByIndex(position) ```js -dropByIndex(position: number): ListNode\ | undefined +dropByIndex(position: number): ListNode | undefined ``` Removes the node with the specified position from the list: @@ -862,7 +862,7 @@ list.dropByIndex(-2); #### dropManyByIndex(count, position) ```js -dropManyByIndex(count: number, position: number): ListNode\\[\] +dropManyByIndex(count: number, position: number): ListNode[] ``` Removes the nodes starting from the specified position from the list based on given count: @@ -896,7 +896,7 @@ list.dropManyByIndex(2, -2); #### dropByValue(value, compareFn) ```js -dropByValue(value: T, compareFn = compare): ListNode\ | undefined +dropByValue(value: T, compareFn = compare): ListNode | undefined ``` Removes the first node with given value from the list: @@ -934,7 +934,7 @@ list.dropByValue(0, (value, searchedValue) => value.x === searchedValue); #### dropByValueAll(value, compareFn) ```js -dropByValueAll(value: T, compareFn = compare): ListNode\\[\] +dropByValueAll(value: T, compareFn = compare): ListNode[] ``` Removes all nodes with given value from the list: @@ -972,7 +972,7 @@ list.dropByValue(0, (value, searchedValue) => value.x === searchedValue); #### drop().head() ```js -drop().head(): ListNode\ | undefined +drop().head(): ListNode | undefined ``` Removes the first node in list: @@ -996,7 +996,7 @@ list.drop().head(); #### drop().tail() ```js -drop().tail(): ListNode\ | undefined +drop().tail(): ListNode | undefined ``` Removes the last node in list: @@ -1020,7 +1020,7 @@ list.drop().tail(); #### drop().byIndex(position) ```js -drop().byIndex(position: number): ListNode\ | undefined +drop().byIndex(position: number): ListNode | undefined ``` Removes the node with the specified position from the list: @@ -1058,7 +1058,7 @@ list.drop().byIndex(-2); #### drop().byValue(value, compareFn) ```js -drop().byValue(value: T, compareFn = compare): ListNode\ | undefined +drop().byValue(value: T, compareFn = compare): ListNode | undefined ``` Removes the first node with given value from the list: @@ -1100,7 +1100,7 @@ list #### drop().byValueAll(value, compareFn) ```js -drop().byValueAll(value: T, compareFn = compare): ListNode\\[\] +drop().byValueAll(value: T, compareFn = compare): ListNode[] ``` Removes all nodes with given value from the list: @@ -1142,7 +1142,7 @@ list #### dropMany(count).head() ```js -dropMany(count: number).head(): ListNode\\[\] +dropMany(count: number).head(): ListNode[] ``` Removes the first nodes from the list based on given count: @@ -1166,7 +1166,7 @@ list.dropMany(2).head(); #### dropMany(count).tail() ```js -dropMany(count: number).tail(): ListNode\\[\] +dropMany(count: number).tail(): ListNode[] ``` Removes the last nodes from the list based on given count: @@ -1190,7 +1190,7 @@ list.dropMany(2).tail(); #### dropMany(count).byIndex(position) ```js -dropMany(count: number).byIndex(position: number): ListNode\\[\] +dropMany(count: number).byIndex(position: number): ListNode[] ``` Removes the nodes starting from the specified position from the list based on given count: @@ -1234,7 +1234,7 @@ There are a few methods to find specific nodes in a linked list. #### find(predicate) ```js -find(predicate: ListIteratorFunction\): ListNode\ | undefined +find(predicate: ListIteratorFunction): ListNode | undefined ``` Finds the first node from the list that matches the given predicate: @@ -1258,7 +1258,7 @@ found.next.value === "b" #### findIndex(predicate) ```js -findIndex(predicate: ListIteratorFunction\): number +findIndex(predicate: ListIteratorFunction): number ``` Finds the position of the first node from the list that matches the given predicate: @@ -1286,7 +1286,7 @@ i3 === -1 #### get(position) ```js -get(position: number): ListNode\ | undefined +get(position: number): ListNode | undefined ``` Finds and returns the node with specific position in the list: @@ -1372,7 +1372,7 @@ There are a few ways to iterate over or display a linked list. #### forEach(callback) ```js -forEach(callback: ListIteratorFunction\): void +forEach(callback: ListIteratorFunction): void ``` Runs a callback function on all nodes in a linked list from head to tail: @@ -1413,7 +1413,7 @@ for(const node of list) { #### toArray() ```js -toArray(): T\[\] +toArray(): T[] ``` Converts a linked list to an array of values: @@ -1435,7 +1435,7 @@ arr === ['a', 'b', 'c'] #### toNodeArray() ```js -toNodeArray(): T\[\] +toNodeArray(): ListNode[] ``` Converts a linked list to an array of nodes: