Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

Bst Avl

БесплатноНе проверен

Enables interactive learning and visualization of Binary Search Trees and AVL Trees through operations like insertion, deletion, and tree traversal, with real-t

GitHubEmbed

Описание

Enables interactive learning and visualization of Binary Search Trees and AVL Trees through operations like insertion, deletion, and tree traversal, with real-time balancing rotations.

README

A Model Context Protocol (MCP) server designed to help you learn and visualize Binary Search Trees (BST) and AVL Trees. This project implements these data structures in TypeScript, demonstrating core algorithms like insertion, deletion, and AVL rotations.

Features

  • Binary Search Tree (BST): Standard implementation.
  • AVL Tree: Self-balancing binary search tree with automatic rotations (Left, Right, Left-Right, Right-Left).
  • Visualization: Tools to print the tree structure to the console/client to see how it changes after operations.
  • Educational Tools: Explicitly designed to help users "hand trace" or visualize specific tree states.

Installation

  1. Clone the repository.
  2. Install dependencies:
    npm install
    

Usage

Building the Server

Compile the TypeScript code:

npm run build

Running the Server

Start the MCP server (stdio transport):

npm start

Running Verification Tests

Run the included test script which demonstrates a sequence of insertions and rotations (based on a classic hand-tracing example):

npm test

Using with Claude Desktop

To use this server with the Claude Desktop app, add the following configuration to your claude_desktop_config.json file:

{
  "mcpServers": {
    "bst-avl": {
      "command": "node",
      "args": [
        "/YourDirectory/bst-avl-mcp/build/index.js"
      ]
    }
  }
}

Note: Update the path to match your project location.

Available Tools

  • reset_tree: Resets the specified tree (bst or avl) to be empty.
  • insert_node: Inserts a number into the tree and returns the new visual structure.
  • delete_node: Deletes a number from the tree and maintains balance (for AVL).
  • search_node: Checks if a number exists in the tree.
  • print_tree: Returns a string representation of the current tree hierarchy.

Project Structure

  • src/bst.ts: Basic BST implementation.
  • src/avl.ts: AVL Tree implementation with rotation logic.
  • src/index.ts: MCP Server entry point.
  • src/types.ts: Shared TypeScript interfaces.

from github.com/jakeoung/bst-avl-mcp

Установка Bst Avl

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/jakeoung/bst-avl-mcp

FAQ

Bst Avl MCP бесплатный?

Да, Bst Avl MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для Bst Avl?

Нет, Bst Avl работает без API-ключей и переменных окружения.

Bst Avl — hosted или self-hosted?

Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.

Как установить Bst Avl в Claude Desktop, Claude Code или Cursor?

Открой Bst Avl на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare Bst Avl with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории development