Skip to content

Commit e3c18d2

Browse files
committed
Exercises, prim_old via search
1 parent 2524df0 commit e3c18d2

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

src/algorithms/extra-info/QSInfo.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Geeks for Geeks Link: [**Quicksort**][G4GLink]
2222

2323
## Exercises/Exploration
2424

25+
The AIA progress bar allows you to see how many steps there are in the
26+
animation, which is a *very rough* guide to run-time. Plot the
27+
number of steps versus the number of data items, for sorted data - what
28+
does it show?
29+
2530
Look into some of the history of quicksort. The basic idea is relatively
2631
simple and was invented long ago. However, it has had a *huge* amount
2732
of work done on it over the years to refine it in many ways - far more

src/algorithms/extra-info/StraightRadixSortInfo.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ In *counting sort*, temporary array **B** is filled by scanning array
2828
**B** would still end up sorted on the digit in question. What would
2929
the affect be on the radix sorting if left to right scanning was used?
3030

31+
How is the run-time of Straight Radix Sort affected by the order of the
32+
data?
33+
34+
The AIA progress bar allows you to see how many steps there are in the
35+
animation, which is a *very rough* guide to run-time. By experimenting
36+
with different input data, can you devise a formula for how many steps
37+
there are, given the number of data items and the number of (base 4)
38+
digits?
39+
3140
Look up how sorting punched cards has been done historically. Card
3241
sorting machines used LSD radix sorting! How could you sort a deck of
3342
playing cards using LSD radix sorting?
43+

src/algorithms/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@ import * as Instructions from './instructions';
2121
algorithm is deployed. Note that the DEFAULT_ALGORITHM from
2222
src/context/actions.js had better be deployed!
2323
XXX Design of noDeploy stuff was done with the aim of minimal code change
24-
and could be re-thought when there are fewer merges going on.
24+
and should be re-thought when there are fewer merges going on.
2525
XXX This has now been totally ****ed up, with multiple lists of
2626
algorithms elsewhere (see components/mainmenu/index.js
27-
components/mainmenu/GraphAlgorithms.js components/AlgorithmMenu.js) as
27+
components/mainmenu/GraphAlgorithms.js etc components/AlgorithmMenu.js) as
2828
well as this file, algorithms/index.js. There should be *one* master
2929
list (eg, this one, possibly with extra info for each algorithm) and the
3030
other lists should be generated from the master list!
31+
Currently with noDeploy=true the algorithm can still be found via the
32+
search function but it then says "Invalid algorithm specified" - see
33+
algorithms/parameters/helpers/urlHelpers.js (XXX that file could use
34+
allalgs instead??)
35+
Now that we can access algorithms via the URL we should be able to use
36+
this mechanism for acess to "hidden" algorithms
3137
3238
Each imported algorithm is expected to be an object of the form:
3339
{ pseudocode: String, explanation: String, run: Function }
@@ -372,7 +378,7 @@ const allalgs = {
372378
// Prim's (simpler code) is superseeded + could do with some work;
373379
// it's included here so it can be run but it's not included in menus
374380
'prim_old': {
375-
noDeploy: true,
381+
// noDeploy: true,
376382
name: 'Prim\'s (simpler code)',
377383
category: 'Graph',
378384
explanation: Explanation.Prims_oldExp,

0 commit comments

Comments
 (0)