File tree Expand file tree Collapse file tree 8 files changed +36
-16
lines changed
components/DataStructures/Array/Array2DRenderer Expand file tree Collapse file tree 8 files changed +36
-16
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,8 @@ export default {
140
140
141
141
nodes . push ( 'i' ) ; // initialize the pq display
142
142
parents . push ( 'Parent[i]' ) ;
143
- minCosts . push ( 'Length[i] (so far)' ) ;
143
+ minCosts . push ( 'Length[i]' ) ;
144
+ // minCosts.push('Length[i] (so far)');
144
145
heuristics . push ( 'heur(i)' ) ;
145
146
finalCosts . push ( 'Final Length' ) ;
146
147
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ export default {
125
125
126
126
nodes . push ( 'i' ) ; // initialize the pq display
127
127
parents . push ( 'Parent[i]' ) ;
128
- minCosts . push ( 'Cost[i] (PQ) ' ) ;
128
+ minCosts . push ( 'Cost[i]' ) ;
129
129
finalCosts . push ( 'Final Cost' ) ;
130
130
131
131
// Initialize the table
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ export default {
142
142
143
143
nodes . push ( 'i' ) ; // initialize the pq display
144
144
parents . push ( 'Parent[i]' ) ;
145
- minCosts . push ( 'Cost[i] (PQ) ' ) ;
145
+ minCosts . push ( 'Cost[i]' ) ;
146
146
finalCosts . push ( 'Final Cost' ) ;
147
147
148
148
// Initialize the table
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ const allalgs = {
197
197
} ,
198
198
'prim_old' : {
199
199
noDeploy : false ,
200
- name : 'Prim\'s (older version )' ,
200
+ name : 'Prim\'s (simpler code )' ,
201
201
category : 'Graph' ,
202
202
explanation : Explanation . Prims_oldExp ,
203
203
param : < Param . Prims_oldParam /> ,
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ import ListParam from './helpers/ListParam';
5
5
import StringParam from './helpers/StringParam' ;
6
6
import '../../styles/Param.scss' ;
7
7
8
- const DEFAULT_STRING = 'abcdefgh ' ;
9
- const DEFAULT_PATTERN = 'efg ' ;
8
+ const DEFAULT_STRING = 'dcaccdddabddac ' ;
9
+ const DEFAULT_PATTERN = 'ddac ' ;
10
10
const BFSS_SEARCH = 'Brute force String Search' ;
11
11
const BFSS_EXAMPLE = 'Enter lower case alphabetic character or space.' ;
12
12
Original file line number Diff line number Diff line change @@ -3,8 +3,10 @@ import React, { useState } from 'react';
3
3
import StringParam from './helpers/StringParam' ;
4
4
import '../../styles/Param.scss' ;
5
5
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' ;
8
10
const HSS_SEARCH = 'Horspool String Search' ;
9
11
const HSS_EXAMPLE = 'Enter lower case alphabetic character or space.' ;
10
12
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const DEFAULT_END = null; // disable end nodes display/input
12
12
// const DEFAULT_END = [10] // start with 10 as end node
13
13
const DEFAULT_HEUR = null ; // disable heuristic display/input
14
14
// const DEFAULT_HEUR = 0; // 0 = Euclidean
15
- const PRIMS = 'New Prim\'s' ;
15
+ const PRIMS = 'Prim\'s (simpler code) ' ;
16
16
// XXX fix up error messages some time and change from 'EXAMPLE'
17
17
const PRIMS_EXAMPLE = 'Please enter positive edge weights (or 0 for no edge)' ;
18
18
const PRIMS_EXAMPLE2 = 'Please enter the symmetrical value in matrix' ;
Original file line number Diff line number Diff line change @@ -192,16 +192,33 @@ class Array2DRenderer extends Renderer {
192
192
</ td >
193
193
) ;
194
194
} ) }
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  </ span >
211
+ </ th >
212
+ ) )
213
+ ||
214
+ ( ( ( algo === 'prim' && i === 2 ) ||
215
+ ( algo === 'dijkstra' && i === 2 )
216
+ ) && (
201
217
< th className = { classes ( styles . col , styles . index ) } >
202
218
< span className = { styles . value } > Priority Queue </ span >
203
219
</ th >
204
- ) ) || < td className = { classes ( styles . col , styles . index ) } /> }
220
+ ) )
221
+ || < td className = { classes ( styles . col , styles . index ) } /> }
205
222
</ tr >
206
223
) ;
207
224
} ) }
You can’t perform that action at this time.
0 commit comments