role-algorithms:sorting-and-searching

Implement sorting, searching, and string-matching algorithms for data manipulation.

14|3|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rnavarych/alpha-engineer --skill role-algorithms-sorting-and-searching
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: role-algorithms:sorting-and-searching
Source: https://github.com/rnavarych/alpha-engineer/tree/main/plugins/roles/role-algorithms/skills/sorting-and-searching
Command: npx skills add https://github.com/rnavarych/alpha-engineer --skill role-algorithms-sorting-and-searching

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides implementations and guidance for a wide array of sorting and searching algorithms, enabling efficient data organization and retrieval.

Core Features & Use Cases

  • Algorithm Selection: Choose the optimal sorting algorithm (comparison-based or non-comparison-based) based on data characteristics like size, distribution, and key type.
  • Efficient Searching: Implement various binary search techniques (standard, lower/upper bound, answer-space) and order statistics (quickselect, streaming median).
  • String Matching: Utilize algorithms like KMP, Boyer-Moore, and Aho-Corasick for single and multi-pattern string searching.
  • External Sorting: Handle datasets that exceed available memory using external merge sort strategies.
  • Use Case: Optimize a database query by implementing an efficient binary search for finding records within a sorted index, or process large log files to find all occurrences of specific error patterns using Aho-Corasick.

Quick Start

Use the sorting and searching skill to find the k-th smallest element in a list of numbers.

Frequently Asked Questions about role-algorithms:sorting-and-searching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the best sorting algorithm for my dataset?

Choosing the best sorting algorithm depends on data characteristics like size, distribution, and key type. Comparison sorts like quicksort handle general data, while non-comparison sorts like radix or counting excel with specific key distributions.

How do I find the k-th smallest element in an unsorted list?

To find the k-th smallest element, use the quickselect algorithm for average O(n) time complexity. Alternatively, streaming median techniques handle order statistics efficiently on continuous data flows.

What is the best way to search for multiple string patterns in large log files?

The best way to search for multiple string patterns simultaneously is using the Aho-Corasick algorithm. It builds an automaton for efficient multi-pattern matching, quickly locating all occurrences of target error patterns.

How does external merge sort work for datasets larger than available memory?

External merge sort handles datasets exceeding available memory by dividing data into manageable chunks, sorting each chunk individually, and then merging the sorted chunks using disk-based operations.

When should I use binary search variants like lower and upper bound?

Use lower and upper bound binary search variants when finding insertion points or range boundaries in sorted data. Answer-space binary search applies when searching monotonic functions rather than discrete values.