cs-data-structures

Installation
SKILL.md

cs-data-structures

Purpose

This skill equips the OpenClaw AI to generate, manipulate, and optimize code for core data structures, including arrays, linked lists, trees (BST, AVL, B-tree), heaps, hash tables, graphs, and tries, to solve programming tasks efficiently.

When to Use

Use this skill when implementing data storage or manipulation in code, such as sorting large datasets with arrays, searching nodes in a BST, or traversing graphs for pathfinding. Apply it in scenarios requiring efficient operations like O(1) lookups in hash tables or balanced trees for sorted data.

Key Capabilities

  • Arrays: Support creation, sorting (e.g., quicksort, mergesort), and searching (e.g., binary search).
  • Linked Lists: Handle singly/doubly linked lists with operations like insertion, deletion, and traversal.
  • Trees: Implement BST for basic searches, AVL for self-balancing, B-tree for disk-based storage; include traversals (in-order, pre-order).
  • Heaps: Manage min/max heaps for priority queues, with heapify and extract operations.
  • Hash Tables: Provide hashing functions, collision resolution (chaining/open addressing), and key-value operations.
  • Graphs: Support adjacency lists/matrices, BFS, DFS, shortest paths (e.g., Dijkstra), and cycle detection.
  • Tries: Enable prefix-based string storage and search for autocomplete features.

Usage Patterns

To invoke this skill, prefix commands with openclaw ds <structure> <action>. Always specify the structure type and action parameters for precision. For code integration, import the generated module and call functions directly. Use in a pipeline: first generate code with a command, then test it in your environment. If using in a script, set the context with --context=project-file.py to embed the code snippet. For repeated use, save outputs to a config file like JSON: {"structure": "bst", "action": "insert", "params": {"value": 5}}.

Related skills
Installs
24
GitHub Stars
5
First Seen
Mar 5, 2026