Skip to content

Commit 82f7153

Browse files
authored
Merge pull request #57 from tuankhainguy/nick_hotfix_instruction
hotfix: instructions for chaining
2 parents 98ff2e5 + 1404353 commit 82f7153

File tree

2 files changed

+42
-7
lines changed

2 files changed

+42
-7
lines changed

src/algorithms/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const allalgs = {
154154
name: 'Hashing (Linear Probing)',
155155
category: 'Insert/Search',
156156
param: <Param.HashingLPParam/>,
157-
instructions: Instructions.HashingInstruction,
157+
instructions: Instructions.HashingLPDHInstruction,
158158
explanation: Explanation.HashingExp,
159159
extraInfo: ExtraInfo.HashingInfo,
160160
pseudocode: {
@@ -171,7 +171,7 @@ const allalgs = {
171171
name: 'Hashing (Double Hashing)',
172172
category: 'Insert/Search',
173173
param: <Param.HashingDHParam/>,
174-
instructions: Instructions.HashingInstruction,
174+
instructions: Instructions.HashingLPDHInstruction,
175175
explanation: Explanation.HashingExp,
176176
extraInfo: ExtraInfo.HashingInfo,
177177
pseudocode: {
@@ -188,7 +188,7 @@ const allalgs = {
188188
name: 'Hashing (Chaining)',
189189
category: 'Insert/Search',
190190
param: <Param.HashingCHParam/>,
191-
instructions: Instructions.HashingInstruction,
191+
instructions: Instructions.HashingCHInstruction,
192192
explanation: Explanation.HashingExp,
193193
extraInfo: ExtraInfo.HashingInfo,
194194
pseudocode: {

src/algorithms/instructions/index.js

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const stringInstructions = [{
5252
],
5353
}];
5454

55-
const hashingInstructions2 = [
55+
const hashingInstructions1 = [
5656
{
5757
title: 'Insert/Delete Mode',
5858
content: [
@@ -68,8 +68,42 @@ const hashingInstructions2 = [
6868
- x - y - z: Bulk insert from integers x to y in steps of z.
6969
- -x: Delete x from table.
7070
71-
If you wish to input more integers, select the Expand radio button.
72-
The table will now expand after reaching 80% capacity`,
71+
Only for small table, if you wish to input more integers, select the Expand radio button.
72+
The table will now expand after reaching 80% capacity until it reaches 97 slots, after which it will
73+
stop at one slot left`,
74+
75+
`Click on ${KEY_INSERT} to enter Insert mode and load the algorithm.`,
76+
`Click on ${KEY_PLAY} to watch the algorithm run. The speed may be adjusted using the speed slider.`,
77+
],
78+
},
79+
{
80+
title: 'Search Mode',
81+
content: [
82+
'Make sure table has inserted values before searching.',
83+
`Click on ${KEY_CODE} on the right panel.`,
84+
'Enter an Integer in the Search parameter.',
85+
`Click on ${KEY_SEARCH} to enter Search mode and load the algorithm.`,
86+
`Click on ${KEY_PLAY} to watch the algorithm run. The speed may be adjusted using the speed slider.`,
87+
],
88+
},
89+
];
90+
91+
const hashingInstructions2 = [
92+
{
93+
title: 'Insert/Delete Mode',
94+
content: [
95+
`Click on ${KEY_CODE} on the right panel.`,
96+
`Select small or larger table via the radio buttons.`,
97+
`Enter a comma separated list of integers into the Insert parameter.
98+
99+
**Valid inputs**:
100+
101+
- x : Insert x into table.
102+
- x - y: Bulk insert from integers x to y.
103+
- x - y - z: Bulk insert from integers x to y in steps of z.
104+
- -x: Delete x from table.
105+
106+
You can hover over a slot to see the chain when you see a .. in the slot`,
73107

74108
`Click on ${KEY_INSERT} to enter Insert mode and load the algorithm.`,
75109
`Click on ${KEY_PLAY} to watch the algorithm run. The speed may be adjusted using the speed slider.`,
@@ -163,4 +197,5 @@ export const ASTARInstruction = graphInstructions;
163197
export const BFSInstruction = graphInstructions;
164198
export const DFSInstruction = graphInstructions;
165199
export const DFSrecInstruction = graphInstructions;
166-
export const HashingInstruction = hashingInstructions2;
200+
export const HashingLPDHInstruction = hashingInstructions1;
201+
export const HashingCHInstruction = hashingInstructions2;

0 commit comments

Comments
 (0)