@@ -11,13 +11,14 @@ import StringSearchAlgorithms from './StringSearchAlgorithms';
11
11
// Get the base URL dynamically
12
12
const baseUrl = window . location . origin ;
13
13
14
- // XXX should have algorithms just listed in one place
14
+ // XXX should have algorithms just listed in one place!
15
15
// (eg src/algorithms/index.js)
16
16
// and filtered appropriately rather
17
17
// than have multiple algorithm lists (here, above, SortingAlgorithms.js,
18
18
// InsertSearchAlgorithms.js etc), as was done previously...
19
19
// XXX also fix display code (see XXX elsewhere) - currently ugly and
20
20
// broken; best just use something simple!
21
+ // This version is used just(?) for the main menu search function
21
22
const allAlgorithms = [
22
23
{ name : 'Brute Force' , url : `${ baseUrl } /?alg=bruteForceStringSearch&mode=search` } ,
23
24
{ name : "Horspool's" , url : `${ baseUrl } /?alg=horspoolStringSearch&mode=search` } ,
@@ -27,20 +28,25 @@ const allAlgorithms = [
27
28
{ name : "Dijkstra's (shortest path)" , url : `${ baseUrl } /?alg=dijkstra&mode=find` } ,
28
29
{ name : 'A* (heuristic search)' , url : `${ baseUrl } /?alg=aStar&mode=find` } ,
29
30
{ name : "Prim's (min. spanning tree)" , url : `${ baseUrl } /?alg=prim&mode=find` } ,
31
+ // prim_old not included in menus
30
32
{ name : "Prim's (simpler code)" , url : `${ baseUrl } /?alg=prim_old&mode=find` } ,
31
33
{ name : "Kruskal's (min. spanning tree)" , url : `${ baseUrl } /?alg=kruskal&mode=find` } ,
32
34
{ name : "Warshall's (transitive closure)" , url : `${ baseUrl } /?alg=transitiveClosure&mode=tc` } ,
33
35
{ name : 'Binary Search Tree' , url : `${ baseUrl } /?alg=binarySearchTree&mode=search` } ,
34
36
{ name : '2-3-4 Tree' , url : `${ baseUrl } /?alg=TTFTree&mode=search` } ,
35
37
{ name : 'AVL Tree' , url : `${ baseUrl } /?alg=AVLTree&mode=search` } ,
38
+ { name : 'Hashing (Linear Probing)' , url : `${ baseUrl } /?alg=HashingLP&mode=search` } ,
39
+ { name : 'Hashing (Double Hashing)' , url : `${ baseUrl } /?alg=HashingDH&mode=search` } ,
40
+ { name : 'Hashing (Chaining)' , url : `${ baseUrl } /?alg=HashingCH&mode=search` } ,
36
41
{ name : 'Union Find' , url : `${ baseUrl } /?alg=unionFind&mode=find` } ,
37
42
{ name : 'Heapsort' , url : `${ baseUrl } /?alg=heapSort&mode=sort` } ,
38
43
{ name : 'Quicksort' , url : `${ baseUrl } /?alg=quickSort&mode=sort` } ,
39
44
{ name : 'Quicksort (Median of 3)' , url : `${ baseUrl } /?alg=quickSortM3&mode=sort` } ,
40
45
{ name : 'Merge Sort' , url : `${ baseUrl } /?alg=msort_arr_td&mode=sort` } ,
41
46
{ name : 'Merge Sort (Bottom-up)' , url : `${ baseUrl } /?alg=msort_arr_bup&mode=sort` } ,
42
47
{ name : 'Merge Sort (Natural)' , url : `${ baseUrl } /?alg=msort_arr_nat&mode=sort` } ,
43
- // XXX don't include list-array mergesort? msort_lista_td
48
+ // msort_lista_td not included in menus
49
+ { name : 'Merge Sort (list rep. as array)' , url : `${ baseUrl } /?alg=msort_lista_td&mode=sort` } ,
44
50
{ name : 'Radix Sort (MSD/Exchange)' , url : `${ baseUrl } /?alg=radixSortMSD&mode=sort` } ,
45
51
{ name : 'Radix Sort (LSD/Straight)' , url : `${ baseUrl } /?alg=radixSortStraigh&mode=sort` } ,
46
52
] ;
@@ -75,6 +81,7 @@ const Mainmenu = () => {
75
81
76
82
const filteredAlgorithms = allAlgorithms . filter ( algorithm =>
77
83
algorithm . name . toLowerCase ( ) . includes ( searchTerm . toLowerCase ( ) )
84
+ // XXX nice to add keyword search also
78
85
) ;
79
86
return (
80
87
< div className = "mainmenu-container" >
0 commit comments