Skip to content

Commit 55685f6

Browse files
committed
Mods from Linda discussion
1 parent 50e0c39 commit 55685f6

File tree

8 files changed

+36
-16
lines changed

8 files changed

+36
-16
lines changed

src/algorithms/controllers/AStar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ export default {
140140

141141
nodes.push('i'); // initialize the pq display
142142
parents.push('Parent[i]');
143-
minCosts.push('Length[i] (so far)');
143+
minCosts.push('Length[i]');
144+
// minCosts.push('Length[i] (so far)');
144145
heuristics.push('heur(i)');
145146
finalCosts.push('Final Length');
146147

src/algorithms/controllers/dijkstra.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default {
125125

126126
nodes.push('i'); // initialize the pq display
127127
parents.push('Parent[i]');
128-
minCosts.push('Cost[i] (PQ)');
128+
minCosts.push('Cost[i]');
129129
finalCosts.push('Final Cost');
130130

131131
// Initialize the table

src/algorithms/controllers/prim.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export default {
142142

143143
nodes.push('i'); // initialize the pq display
144144
parents.push('Parent[i]');
145-
minCosts.push('Cost[i] (PQ)');
145+
minCosts.push('Cost[i]');
146146
finalCosts.push('Final Cost');
147147

148148
// Initialize the table

src/algorithms/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ const allalgs = {
197197
},
198198
'prim_old': {
199199
noDeploy: false,
200-
name: 'Prim\'s (older version)',
200+
name: 'Prim\'s (simpler code)',
201201
category: 'Graph',
202202
explanation: Explanation.Prims_oldExp,
203203
param: <Param.Prims_oldParam />,

src/algorithms/parameters/BFSSParam.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import ListParam from './helpers/ListParam';
55
import StringParam from './helpers/StringParam';
66
import '../../styles/Param.scss';
77

8-
const DEFAULT_STRING = 'abcdefgh';
9-
const DEFAULT_PATTERN = 'efg';
8+
const DEFAULT_STRING = 'dcaccdddabddac';
9+
const DEFAULT_PATTERN = 'ddac';
1010
const BFSS_SEARCH = 'Brute force String Search';
1111
const BFSS_EXAMPLE = 'Enter lower case alphabetic character or space.';
1212

src/algorithms/parameters/HSSParam.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import React, { useState } from 'react';
33
import StringParam from './helpers/StringParam';
44
import '../../styles/Param.scss';
55

6-
const DEFAULT_STRING = 'cddaadddabdda';
7-
const DEFAULT_PATTERN = 'dddac';
6+
// const DEFAULT_STRING = 'cddaadddabdda';
7+
// const DEFAULT_PATTERN = 'dddac';
8+
const DEFAULT_STRING = 'dcaccdddabddac';
9+
const DEFAULT_PATTERN = 'ddac';
810
const HSS_SEARCH = 'Horspool String Search';
911
const HSS_EXAMPLE = 'Enter lower case alphabetic character or space.';
1012

src/algorithms/parameters/PRIM_oldParam.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const DEFAULT_END = null; // disable end nodes display/input
1212
// const DEFAULT_END = [10] // start with 10 as end node
1313
const DEFAULT_HEUR = null; // disable heuristic display/input
1414
// const DEFAULT_HEUR = 0; // 0 = Euclidean
15-
const PRIMS = 'New Prim\'s';
15+
const PRIMS = 'Prim\'s (simpler code)';
1616
// XXX fix up error messages some time and change from 'EXAMPLE'
1717
const PRIMS_EXAMPLE = 'Please enter positive edge weights (or 0 for no edge)';
1818
const PRIMS_EXAMPLE2 = 'Please enter the symmetrical value in matrix';

src/components/DataStructures/Array/Array2DRenderer/index.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,33 @@ class Array2DRenderer extends Renderer {
192192
</td>
193193
);
194194
})}
195-
{(pointer && algo === 'tc' && (
196-
<th className={classes(styles.col, styles.index)}>
197-
<span className={styles.value}> i </span>
198-
</th>
199-
)) ||
200-
(algo === 'prim' && i === 2 && (
195+
{
196+
(pointer && algo === 'tc' && (
197+
<th className={classes(styles.col, styles.index)}>
198+
<span className={styles.value}> i </span>
199+
</th>
200+
))
201+
||
202+
(algo === 'aStar' && i === 1 && (
203+
<th className={classes(styles.col, styles.index)}>
204+
<span className={styles.value}> )Priority </span>
205+
</th>
206+
))
207+
||
208+
(algo === 'aStar' && i === 2 && (
209+
<th className={classes(styles.col, styles.index)}>
210+
<span className={styles.value}> )Queue&ensp; </span>
211+
</th>
212+
))
213+
||
214+
(((algo === 'prim' && i === 2) ||
215+
(algo === 'dijkstra' && i === 2)
216+
) && (
201217
<th className={classes(styles.col, styles.index)}>
202218
<span className={styles.value}> Priority Queue </span>
203219
</th>
204-
)) || <td className={classes(styles.col, styles.index)} />}
220+
))
221+
|| <td className={classes(styles.col, styles.index)} />}
205222
</tr>
206223
);
207224
})}

0 commit comments

Comments
 (0)