skills/computer-science/cs-data-structures/SKILL.md
Data structures: arrays, linked lists, trees BST/AVL/B-tree, heaps, hash tables, graphs, tries
npx skillsauth add alphaonedev/openclaw-graph cs-data-structuresInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
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.
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}}.
Use the OpenClaw CLI for direct execution. Commands require authentication via the environment variable $OPENCLAW_API_KEY. Example CLI flags:
openclaw ds array create --size=10 --init=[1,2,3,4] to generate an array initialization snippet.openclaw ds tree bst insert --node=5 --root=var_root to add a node to a BST (output: 2-3 lines of code).openclaw ds graph bfs --vertices=5 --edges='[[0,1],[1,2]]' for BFS traversal code.
For API integration, send HTTP requests to endpoints like POST /api/ds/{structure} with a JSON body, e.g., {"action": "sort", "params": {"array": [4,2,1], "algorithm": "quicksort"}}. Code snippets:# Example for hash table insertion
hash_table = {} # Generated by openclaw ds hash create
hash_table['key'] = 'value' # Use openclaw ds hash insert --key='key' --value='value'
# Example for linked list traversal
node = head # From openclaw ds linkedlist create
while node: # Traverse using openclaw ds linkedlist traverse
print(node.data)
node = node.next
Integrate this skill into your codebase by generating snippets and importing them as modules. For authentication, set $OPENCLAW_API_KEY in your environment before running commands, e.g., export OPENCLAW_API_KEY=your_api_key. Use config files in YAML format for multi-step operations: structure: bst, actions: [insert, search]. Chain with other OpenClaw skills by piping outputs, e.g., openclaw ds graph create | openclaw cs-algorithms bfs. Ensure your project uses compatible languages like Python or C++ by specifying --lang=python.
Always validate inputs before commands, e.g., check if structure types are valid (use openclaw ds list to query available structures). Common errors include invalid parameters (e.g., negative array size), handled by returning error codes like 400 with messages: "Error: Array size must be positive." In code snippets, wrap operations in try-except blocks, e.g.:
try:
result = bst.search(5) # From openclaw ds tree bst search
except KeyError:
print("Node not found")
For API calls, check HTTP status codes and parse error responses. Retry transient errors with exponential backoff if API rate-limited.
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui