@@ -11,13 +11,14 @@ import StringSearchAlgorithms from './StringSearchAlgorithms';
1111// Get the base URL dynamically
1212const baseUrl = window . location . origin ;
1313
14- // XXX should have algorithms just listed in one place
14+ // XXX should have algorithms just listed in one place!
1515// (eg src/algorithms/index.js)
1616// and filtered appropriately rather
1717// than have multiple algorithm lists (here, above, SortingAlgorithms.js,
1818// InsertSearchAlgorithms.js etc), as was done previously...
1919// XXX also fix display code (see XXX elsewhere) - currently ugly and
2020// broken; best just use something simple!
21+ // This version is used just(?) for the main menu search function
2122const allAlgorithms = [
2223 { name : 'Brute Force' , url : `${ baseUrl } /?alg=bruteForceStringSearch&mode=search` } ,
2324 { name : "Horspool's" , url : `${ baseUrl } /?alg=horspoolStringSearch&mode=search` } ,
@@ -27,20 +28,25 @@ const allAlgorithms = [
2728 { name : "Dijkstra's (shortest path)" , url : `${ baseUrl } /?alg=dijkstra&mode=find` } ,
2829 { name : 'A* (heuristic search)' , url : `${ baseUrl } /?alg=aStar&mode=find` } ,
2930 { name : "Prim's (min. spanning tree)" , url : `${ baseUrl } /?alg=prim&mode=find` } ,
31+ // prim_old not included in menus
3032 { name : "Prim's (simpler code)" , url : `${ baseUrl } /?alg=prim_old&mode=find` } ,
3133 { name : "Kruskal's (min. spanning tree)" , url : `${ baseUrl } /?alg=kruskal&mode=find` } ,
3234 { name : "Warshall's (transitive closure)" , url : `${ baseUrl } /?alg=transitiveClosure&mode=tc` } ,
3335 { name : 'Binary Search Tree' , url : `${ baseUrl } /?alg=binarySearchTree&mode=search` } ,
3436 { name : '2-3-4 Tree' , url : `${ baseUrl } /?alg=TTFTree&mode=search` } ,
3537 { 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` } ,
3641 { name : 'Union Find' , url : `${ baseUrl } /?alg=unionFind&mode=find` } ,
3742 { name : 'Heapsort' , url : `${ baseUrl } /?alg=heapSort&mode=sort` } ,
3843 { name : 'Quicksort' , url : `${ baseUrl } /?alg=quickSort&mode=sort` } ,
3944 { name : 'Quicksort (Median of 3)' , url : `${ baseUrl } /?alg=quickSortM3&mode=sort` } ,
4045 { name : 'Merge Sort' , url : `${ baseUrl } /?alg=msort_arr_td&mode=sort` } ,
4146 { name : 'Merge Sort (Bottom-up)' , url : `${ baseUrl } /?alg=msort_arr_bup&mode=sort` } ,
4247 { 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` } ,
4450 { name : 'Radix Sort (MSD/Exchange)' , url : `${ baseUrl } /?alg=radixSortMSD&mode=sort` } ,
4551 { name : 'Radix Sort (LSD/Straight)' , url : `${ baseUrl } /?alg=radixSortStraigh&mode=sort` } ,
4652 ] ;
@@ -75,6 +81,7 @@ const Mainmenu = () => {
7581
7682 const filteredAlgorithms = allAlgorithms . filter ( algorithm =>
7783 algorithm . name . toLowerCase ( ) . includes ( searchTerm . toLowerCase ( ) )
84+ // XXX nice to add keyword search also
7885 ) ;
7986 return (
8087 < div className = "mainmenu-container" >
0 commit comments