data-structure-typed 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/cjs/data-structures/graph/abstract-graph.js +14 -14
  3. package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -1
  4. package/dist/cjs/data-structures/hash/hash-map.d.ts +46 -0
  5. package/dist/cjs/data-structures/hash/hash-map.js +46 -0
  6. package/dist/cjs/data-structures/hash/hash-map.js.map +1 -1
  7. package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +66 -0
  8. package/dist/cjs/data-structures/linked-list/singly-linked-list.js +66 -0
  9. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
  10. package/dist/cjs/data-structures/queue/queue.d.ts +47 -0
  11. package/dist/cjs/data-structures/queue/queue.js +47 -0
  12. package/dist/cjs/data-structures/queue/queue.js.map +1 -1
  13. package/dist/cjs/data-structures/stack/stack.d.ts +121 -0
  14. package/dist/cjs/data-structures/stack/stack.js +121 -0
  15. package/dist/cjs/data-structures/stack/stack.js.map +1 -1
  16. package/dist/esm/data-structures/graph/abstract-graph.js +14 -14
  17. package/dist/esm/data-structures/graph/abstract-graph.js.map +1 -1
  18. package/dist/esm/data-structures/hash/hash-map.d.ts +46 -0
  19. package/dist/esm/data-structures/hash/hash-map.js +46 -0
  20. package/dist/esm/data-structures/hash/hash-map.js.map +1 -1
  21. package/dist/esm/data-structures/linked-list/singly-linked-list.d.ts +66 -0
  22. package/dist/esm/data-structures/linked-list/singly-linked-list.js +66 -0
  23. package/dist/esm/data-structures/linked-list/singly-linked-list.js.map +1 -1
  24. package/dist/esm/data-structures/queue/queue.d.ts +47 -0
  25. package/dist/esm/data-structures/queue/queue.js +47 -0
  26. package/dist/esm/data-structures/queue/queue.js.map +1 -1
  27. package/dist/esm/data-structures/stack/stack.d.ts +121 -0
  28. package/dist/esm/data-structures/stack/stack.js +121 -0
  29. package/dist/esm/data-structures/stack/stack.js.map +1 -1
  30. package/dist/individuals/binary-tree/avl-tree-counter.mjs +4701 -0
  31. package/dist/individuals/binary-tree/avl-tree-multi-map.mjs +4514 -0
  32. package/dist/individuals/binary-tree/avl-tree.mjs +4321 -0
  33. package/dist/individuals/binary-tree/binary-tree.mjs +3097 -0
  34. package/dist/individuals/binary-tree/bst.mjs +3858 -0
  35. package/dist/individuals/binary-tree/red-black-tree.mjs +4391 -0
  36. package/dist/individuals/binary-tree/tree-counter.mjs +4806 -0
  37. package/dist/individuals/binary-tree/tree-multi-map.mjs +4582 -0
  38. package/dist/individuals/graph/directed-graph.mjs +2910 -0
  39. package/dist/individuals/graph/undirected-graph.mjs +2745 -0
  40. package/dist/individuals/hash/hash-map.mjs +1040 -0
  41. package/dist/individuals/heap/heap.mjs +909 -0
  42. package/dist/individuals/heap/max-heap.mjs +671 -0
  43. package/dist/individuals/heap/min-heap.mjs +659 -0
  44. package/dist/individuals/linked-list/doubly-linked-list.mjs +1495 -0
  45. package/dist/individuals/linked-list/singly-linked-list.mjs +1479 -0
  46. package/dist/individuals/priority-queue/max-priority-queue.mjs +768 -0
  47. package/dist/individuals/priority-queue/min-priority-queue.mjs +757 -0
  48. package/dist/individuals/priority-queue/priority-queue.mjs +670 -0
  49. package/dist/individuals/queue/deque.mjs +1262 -0
  50. package/dist/individuals/queue/queue.mjs +1865 -0
  51. package/dist/individuals/stack/stack.mjs +415 -0
  52. package/dist/individuals/trie/trie.mjs +687 -0
  53. package/dist/umd/data-structure-typed.js +14 -14
  54. package/dist/umd/data-structure-typed.min.js +2 -2
  55. package/dist/umd/data-structure-typed.min.js.map +1 -1
  56. package/package.json +2 -2
  57. package/src/data-structures/graph/abstract-graph.ts +14 -14
  58. package/src/data-structures/hash/hash-map.ts +46 -0
  59. package/src/data-structures/linked-list/singly-linked-list.ts +66 -0
  60. package/src/data-structures/queue/queue.ts +47 -0
  61. package/src/data-structures/stack/stack.ts +121 -0
  62. package/test/unit/data-structures/graph/directed-graph.test.ts +37 -37
  63. package/test/unit/data-structures/graph/undirected-graph.test.ts +2 -2
  64. package/test/unit/data-structures/hash/hash-map.test.ts +135 -0
  65. package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +72 -1
  66. package/test/unit/data-structures/queue/queue.test.ts +214 -0
  67. package/test/unit/data-structures/stack/stack.test.ts +165 -0
@@ -14,6 +14,127 @@ import { IterableElementBase } from '../base';
14
14
  * 4. Function Calls: In most modern programming languages, the records of function calls are managed through a stack. When a function is called, its record (including parameters, local variables, and return address) is 'pushed' into the stack. When the function returns, its record is 'popped' from the stack.
15
15
  * 5. Expression Evaluation: Used for the evaluation of arithmetic or logical expressions, especially when dealing with parenthesis matching and operator precedence.
16
16
  * 6. Backtracking Algorithms: In problems where multiple branches need to be explored but only one branch can be explored at a time, stacks can be used to save the state at each branching point.
17
+ * @example
18
+ * // Balanced Parentheses or Brackets
19
+ * type ValidCharacters = ')' | '(' | ']' | '[' | '}' | '{';
20
+ *
21
+ * const stack = new Stack<string>();
22
+ * const input: ValidCharacters[] = '[({})]'.split('') as ValidCharacters[];
23
+ * const matches: { [key in ValidCharacters]?: ValidCharacters } = { ')': '(', ']': '[', '}': '{' };
24
+ * for (const char of input) {
25
+ * if ('([{'.includes(char)) {
26
+ * stack.push(char);
27
+ * } else if (')]}'.includes(char)) {
28
+ * if (stack.pop() !== matches[char]) {
29
+ * fail('Parentheses are not balanced');
30
+ * }
31
+ * }
32
+ * }
33
+ * console.log(stack.isEmpty()); // true
34
+ * @example
35
+ * // Expression Evaluation and Conversion
36
+ * const stack = new Stack<number>();
37
+ * const expression = [5, 3, '+']; // Equivalent to 5 + 3
38
+ * expression.forEach(token => {
39
+ * if (typeof token === 'number') {
40
+ * stack.push(token);
41
+ * } else {
42
+ * const b = stack.pop()!;
43
+ * const a = stack.pop()!;
44
+ * stack.push(token === '+' ? a + b : 0); // Only handling '+' here
45
+ * }
46
+ * });
47
+ * console.log(stack.pop()); // 8
48
+ * @example
49
+ * // Depth-First Search (DFS)
50
+ * const stack = new Stack<number>();
51
+ * const graph: { [key in number]: number[] } = { 1: [2, 3], 2: [4], 3: [5], 4: [], 5: [] };
52
+ * const visited: number[] = [];
53
+ * stack.push(1);
54
+ * while (!stack.isEmpty()) {
55
+ * const node = stack.pop()!;
56
+ * if (!visited.includes(node)) {
57
+ * visited.push(node);
58
+ * graph[node].forEach(neighbor => stack.push(neighbor));
59
+ * }
60
+ * }
61
+ * console.log(visited); // [1, 3, 5, 2, 4]
62
+ * @example
63
+ * // Backtracking Algorithms
64
+ * const stack = new Stack<[number, number]>();
65
+ * const maze = [
66
+ * ['S', ' ', 'X'],
67
+ * ['X', ' ', 'X'],
68
+ * [' ', ' ', 'E']
69
+ * ];
70
+ * const start: [number, number] = [0, 0];
71
+ * const end = [2, 2];
72
+ * const directions = [
73
+ * [0, 1], // To the right
74
+ * [1, 0], // down
75
+ * [0, -1], // left
76
+ * [-1, 0] // up
77
+ * ];
78
+ *
79
+ * const visited = new Set<string>(); // Used to record visited nodes
80
+ * stack.push(start);
81
+ * const path: number[][] = [];
82
+ *
83
+ * while (!stack.isEmpty()) {
84
+ * const [x, y] = stack.pop()!;
85
+ * if (visited.has(`${x},${y}`)) continue; // Skip already visited nodes
86
+ * visited.add(`${x},${y}`);
87
+ *
88
+ * path.push([x, y]);
89
+ *
90
+ * if (x === end[0] && y === end[1]) {
91
+ * break; // Find the end point and exit
92
+ * }
93
+ *
94
+ * for (const [dx, dy] of directions) {
95
+ * const nx = x + dx;
96
+ * const ny = y + dy;
97
+ * if (
98
+ * maze[nx]?.[ny] === ' ' || // feasible path
99
+ * maze[nx]?.[ny] === 'E' // destination
100
+ * ) {
101
+ * stack.push([nx, ny]);
102
+ * }
103
+ * }
104
+ * }
105
+ *
106
+ * expect(path).toContainEqual(end);
107
+ * @example
108
+ * // Function Call Stack
109
+ * const functionStack = new Stack<string>();
110
+ * functionStack.push('main');
111
+ * functionStack.push('foo');
112
+ * functionStack.push('bar');
113
+ * console.log(functionStack.pop()); // 'bar'
114
+ * console.log(functionStack.pop()); // 'foo'
115
+ * console.log(functionStack.pop()); // 'main'
116
+ * @example
117
+ * // Simplify File Paths
118
+ * const stack = new Stack<string>();
119
+ * const path = '/a/./b/../../c';
120
+ * path.split('/').forEach(segment => {
121
+ * if (segment === '..') stack.pop();
122
+ * else if (segment && segment !== '.') stack.push(segment);
123
+ * });
124
+ * console.log(stack.elements.join('/')); // 'c'
125
+ * @example
126
+ * // Stock Span Problem
127
+ * const stack = new Stack<number>();
128
+ * const prices = [100, 80, 60, 70, 60, 75, 85];
129
+ * const spans: number[] = [];
130
+ * prices.forEach((price, i) => {
131
+ * while (!stack.isEmpty() && prices[stack.peek()!] <= price) {
132
+ * stack.pop();
133
+ * }
134
+ * spans.push(stack.isEmpty() ? i + 1 : i - stack.peek()!);
135
+ * stack.push(i);
136
+ * });
137
+ * console.log(spans); // [1, 1, 1, 2, 1, 4, 6]
17
138
  */
18
139
  export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
19
140
  constructor(elements?: Iterable<E> | Iterable<R>, options?: StackOptions<E, R>);
@@ -6,6 +6,127 @@ import { IterableElementBase } from '../base';
6
6
  * 4. Function Calls: In most modern programming languages, the records of function calls are managed through a stack. When a function is called, its record (including parameters, local variables, and return address) is 'pushed' into the stack. When the function returns, its record is 'popped' from the stack.
7
7
  * 5. Expression Evaluation: Used for the evaluation of arithmetic or logical expressions, especially when dealing with parenthesis matching and operator precedence.
8
8
  * 6. Backtracking Algorithms: In problems where multiple branches need to be explored but only one branch can be explored at a time, stacks can be used to save the state at each branching point.
9
+ * @example
10
+ * // Balanced Parentheses or Brackets
11
+ * type ValidCharacters = ')' | '(' | ']' | '[' | '}' | '{';
12
+ *
13
+ * const stack = new Stack<string>();
14
+ * const input: ValidCharacters[] = '[({})]'.split('') as ValidCharacters[];
15
+ * const matches: { [key in ValidCharacters]?: ValidCharacters } = { ')': '(', ']': '[', '}': '{' };
16
+ * for (const char of input) {
17
+ * if ('([{'.includes(char)) {
18
+ * stack.push(char);
19
+ * } else if (')]}'.includes(char)) {
20
+ * if (stack.pop() !== matches[char]) {
21
+ * fail('Parentheses are not balanced');
22
+ * }
23
+ * }
24
+ * }
25
+ * console.log(stack.isEmpty()); // true
26
+ * @example
27
+ * // Expression Evaluation and Conversion
28
+ * const stack = new Stack<number>();
29
+ * const expression = [5, 3, '+']; // Equivalent to 5 + 3
30
+ * expression.forEach(token => {
31
+ * if (typeof token === 'number') {
32
+ * stack.push(token);
33
+ * } else {
34
+ * const b = stack.pop()!;
35
+ * const a = stack.pop()!;
36
+ * stack.push(token === '+' ? a + b : 0); // Only handling '+' here
37
+ * }
38
+ * });
39
+ * console.log(stack.pop()); // 8
40
+ * @example
41
+ * // Depth-First Search (DFS)
42
+ * const stack = new Stack<number>();
43
+ * const graph: { [key in number]: number[] } = { 1: [2, 3], 2: [4], 3: [5], 4: [], 5: [] };
44
+ * const visited: number[] = [];
45
+ * stack.push(1);
46
+ * while (!stack.isEmpty()) {
47
+ * const node = stack.pop()!;
48
+ * if (!visited.includes(node)) {
49
+ * visited.push(node);
50
+ * graph[node].forEach(neighbor => stack.push(neighbor));
51
+ * }
52
+ * }
53
+ * console.log(visited); // [1, 3, 5, 2, 4]
54
+ * @example
55
+ * // Backtracking Algorithms
56
+ * const stack = new Stack<[number, number]>();
57
+ * const maze = [
58
+ * ['S', ' ', 'X'],
59
+ * ['X', ' ', 'X'],
60
+ * [' ', ' ', 'E']
61
+ * ];
62
+ * const start: [number, number] = [0, 0];
63
+ * const end = [2, 2];
64
+ * const directions = [
65
+ * [0, 1], // To the right
66
+ * [1, 0], // down
67
+ * [0, -1], // left
68
+ * [-1, 0] // up
69
+ * ];
70
+ *
71
+ * const visited = new Set<string>(); // Used to record visited nodes
72
+ * stack.push(start);
73
+ * const path: number[][] = [];
74
+ *
75
+ * while (!stack.isEmpty()) {
76
+ * const [x, y] = stack.pop()!;
77
+ * if (visited.has(`${x},${y}`)) continue; // Skip already visited nodes
78
+ * visited.add(`${x},${y}`);
79
+ *
80
+ * path.push([x, y]);
81
+ *
82
+ * if (x === end[0] && y === end[1]) {
83
+ * break; // Find the end point and exit
84
+ * }
85
+ *
86
+ * for (const [dx, dy] of directions) {
87
+ * const nx = x + dx;
88
+ * const ny = y + dy;
89
+ * if (
90
+ * maze[nx]?.[ny] === ' ' || // feasible path
91
+ * maze[nx]?.[ny] === 'E' // destination
92
+ * ) {
93
+ * stack.push([nx, ny]);
94
+ * }
95
+ * }
96
+ * }
97
+ *
98
+ * expect(path).toContainEqual(end);
99
+ * @example
100
+ * // Function Call Stack
101
+ * const functionStack = new Stack<string>();
102
+ * functionStack.push('main');
103
+ * functionStack.push('foo');
104
+ * functionStack.push('bar');
105
+ * console.log(functionStack.pop()); // 'bar'
106
+ * console.log(functionStack.pop()); // 'foo'
107
+ * console.log(functionStack.pop()); // 'main'
108
+ * @example
109
+ * // Simplify File Paths
110
+ * const stack = new Stack<string>();
111
+ * const path = '/a/./b/../../c';
112
+ * path.split('/').forEach(segment => {
113
+ * if (segment === '..') stack.pop();
114
+ * else if (segment && segment !== '.') stack.push(segment);
115
+ * });
116
+ * console.log(stack.elements.join('/')); // 'c'
117
+ * @example
118
+ * // Stock Span Problem
119
+ * const stack = new Stack<number>();
120
+ * const prices = [100, 80, 60, 70, 60, 75, 85];
121
+ * const spans: number[] = [];
122
+ * prices.forEach((price, i) => {
123
+ * while (!stack.isEmpty() && prices[stack.peek()!] <= price) {
124
+ * stack.pop();
125
+ * }
126
+ * spans.push(stack.isEmpty() ? i + 1 : i - stack.peek()!);
127
+ * stack.push(i);
128
+ * });
129
+ * console.log(spans); // [1, 1, 1, 2, 1, 4, 6]
9
130
  */
10
131
  export class Stack extends IterableElementBase {
11
132
  constructor(elements = [], options) {
@@ -1 +1 @@
1
- {"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../../src/data-structures/stack/stack.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE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