Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/algorithms/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const allalgs = {
name: 'Hashing (Linear Probing)',
category: 'Insert/Search',
param: <Param.HashingLPParam/>,
instructions: Instructions.HashingInstruction,
instructions: Instructions.HashingLPDHInstruction,
explanation: Explanation.HashingExp,
extraInfo: ExtraInfo.HashingInfo,
pseudocode: {
Expand All @@ -171,7 +171,7 @@ const allalgs = {
name: 'Hashing (Double Hashing)',
category: 'Insert/Search',
param: <Param.HashingDHParam/>,
instructions: Instructions.HashingInstruction,
instructions: Instructions.HashingLPDHInstruction,
explanation: Explanation.HashingExp,
extraInfo: ExtraInfo.HashingInfo,
pseudocode: {
Expand All @@ -188,7 +188,7 @@ const allalgs = {
name: 'Hashing (Chaining)',
category: 'Insert/Search',
param: <Param.HashingCHParam/>,
instructions: Instructions.HashingInstruction,
instructions: Instructions.HashingCHInstruction,
explanation: Explanation.HashingExp,
extraInfo: ExtraInfo.HashingInfo,
pseudocode: {
Expand Down
43 changes: 39 additions & 4 deletions src/algorithms/instructions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const stringInstructions = [{
],
}];

const hashingInstructions2 = [
const hashingInstructions1 = [
{
title: 'Insert/Delete Mode',
content: [
Expand All @@ -68,8 +68,42 @@ const hashingInstructions2 = [
- x - y - z: Bulk insert from integers x to y in steps of z.
- -x: Delete x from table.

If you wish to input more integers, select the Expand radio button.
The table will now expand after reaching 80% capacity`,
Only for small table, if you wish to input more integers, select the Expand radio button.
The table will now expand after reaching 80% capacity until it reaches 97 slots, after which it will
stop at one slot left`,

`Click on ${KEY_INSERT} to enter Insert mode and load the algorithm.`,
`Click on ${KEY_PLAY} to watch the algorithm run. The speed may be adjusted using the speed slider.`,
],
},
{
title: 'Search Mode',
content: [
'Make sure table has inserted values before searching.',
`Click on ${KEY_CODE} on the right panel.`,
'Enter an Integer in the Search parameter.',
`Click on ${KEY_SEARCH} to enter Search mode and load the algorithm.`,
`Click on ${KEY_PLAY} to watch the algorithm run. The speed may be adjusted using the speed slider.`,
],
},
];

const hashingInstructions2 = [
{
title: 'Insert/Delete Mode',
content: [
`Click on ${KEY_CODE} on the right panel.`,
`Select small or larger table via the radio buttons.`,
`Enter a comma separated list of integers into the Insert parameter.

**Valid inputs**:

- x : Insert x into table.
- x - y: Bulk insert from integers x to y.
- x - y - z: Bulk insert from integers x to y in steps of z.
- -x: Delete x from table.

You can hover over a slot to see the chain when you see a .. in the slot`,

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