# Algorithm Analysis Examples

## Example 1: Analyzing QuickSort

**Input:**
```
QuickSort is a divide-and-conquer algorithm that selects a pivot element and partitions the array around it, recursively sorting the sub-arrays.
```

**Expected Output:**
Complete analysis with O(n log n) average case, O(n²) worst case, comparison with MergeSort and HeapSort, use cases for in-place sorting.

## Example 2: Comparing Search Algorithms

**Input:**
```
Compare binary search, linear search, and interpolation search for finding elements in sorted arrays.
```

**Expected Output:**
Comparison table showing binary search O(log n), linear search O(n), interpolation search O(log log n) for uniformly distributed data, with use case recommendations.

## Example 3: Graph Algorithm Analysis

**Input:**
```
Explain Dijkstra's shortest path algorithm and when to use it versus Bellman-Ford or A*.
```

**Expected Output:**
Dijkstra's algorithm analysis with O((V+E) log V) complexity, comparison showing Dijkstra for non-negative weights, Bellman-Ford for negative weights, A* for heuristic-guided search.

## Usage Tips

- Provide algorithm name or description for analysis
- Include specific comparison requests if needed
- Mention domain constraints (e.g., "for real-time systems")
- Ask about specific complexity aspects if needed
- Request implementation considerations for specific languages

## Common Use Cases

- Algorithm selection for specific problems
- Performance optimization analysis
- Complexity analysis for code review
- Interview preparation
- Educational explanations
- Research paper comprehension
