Time complexities of Algorithms
Step 1: Select Algorithms
- The simulation is divided into 5 steps, each focusing on a specific category of algorithms.
- Use the "Next Step" and "Previous Step" buttons to navigate between categories:
- Step 1: Linear vs Logarithmic (Binary Search, Linear Search)
- Step 2: Sorting Algorithms (Quick Sort, Bubble Sort)
- Step 3: Matrix Operations (Matrix Addition, Matrix Multiplication)
- Step 4: Exponential/Factorial (Subset Generation, Permutations)
- Step 5: Custom – Compare any algorithms of your choice
- Click the "+ Algorithm Name" buttons to add algorithms for comparison.
Step 2: Choose Maximum Input Size (N)
- Select a value of N from the available radio buttons.
- The available N values depend on the selected step to ensure reasonable execution times.
Step 3: Set Simulation Time (Optional)
- Use the "Max Simulation Time" dropdown to limit how long each algorithm runs.
- The default is 5 seconds. Increase this limit for larger inputs if needed.
Step 4: Lock and Run
- Check the "Lock Values" checkbox to finalize your selections.
- Click "Generate Inputs and Run Algorithm" to start the simulation.
- Wait for all algorithms to complete execution.
Step 5: Analyze Results
- View the execution time table showing time (in ms) for each algorithm at different input sizes.
- Observe the graph to visually compare how execution times grow with input size.
- Read the info text below the graph for insights about the comparison.
Understanding the Table:
- Each cell shows the execution time in milliseconds for a specific algorithm and input size.
- "Time/Memory Limit" appears when:
- The algorithm exceeds the maximum allowed input size (e.g., Bubble Sort is limited to N ≤ 5000 to prevent browser freeze).
- The execution time exceeds the maximum simulation time you selected.
- The algorithm requires too much memory for the given input size.
- This helps protect your browser from freezing on computationally expensive operations.
Step 6: Reset and Explore
- Click "Reset" to clear selections and try a different comparison.
- Navigate to other steps to explore more algorithm categories.
Tip: Hover over any algorithm button to see its time complexity before selecting!