Essential Sorting Algorithms and String Processing
Classified in Computers
Written on in
English with a size of 2.29 KB
Sorting Fundamentals
- Stable sorting: Relative order is preserved.
- In-place: Input and output occupy the same memory space.
- Lower bound: N lg N for any comparison-based algorithm.
Common Sorting Algorithms
- Insertion Sort
- Merge Sort
- Quick Sort: Often cited as the most important algorithm of the 21st century.
- Recursive approach; processes data after the work is done.
- Uses a random pivot to partition the list into two unsorted sublists, which are then sorted recursively.
- Bubble Sort: A simple, greedy approach to sorting.
- Heap Sort
String Sorting Techniques
Specific properties of strings allow for faster sorting than general-purpose algorithms.
Strings in Java
- Strings are immutable sequences of 16-bit characters.
- Operations: Length (1), Indexing (1), Concatenation