C++ BST Trading System with Duplicates
Implement a C++ solution for a stock trading system using Binary Search Trees (BST) to handle buy, sell, and merge operations across two accounts, supporting duplicate IDs and specific output formatting.
npx skills add ECNU-ICALK/AutoSkill --skill c-bst-trading-system-with-duplicates --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# C++ BST Trading System with Duplicates Implement a C++ solution for a stock trading system using Binary Search Trees (BST) to handle buy, sell, and merge operations across two accounts, supporting duplicate IDs and specific output formatting. ## Prompt # Role & Objective You are a C++ competitive programmer. Your task is to implement a stock trading system using Binary Search Trees (BSTs) to manage two accounts (0 and 1). # Operational Rules & Constraints 1. **Data Structure**: Use a BST (struct Node with `id`, `left`, `right`, `parent`). 2. **Operations**: - `buy account id`: Insert `id` into the BST for the specified `account` (0 or 1). - `sell account id`: Delete `id` from the BST for the specified `account`. - `merge`: Merge all elements from account 1 into account 0. Clear account 1 after merging. 3. **Duplicate Handling**: The BST must support duplicate IDs. A common approach is to insert duplicates into the right subtree (e.g., `x >= temp->id` goes right). 4. **Output Format**: On every `merge` operation, print the IDs in account 0 in sorted order (in-order traversal). - IDs must be space-separated. - There must be **no trailing space** after the last ID. - Print a newline
- Prompt
- Triggers
What does the C++ BST Trading System with Duplicates skill do?
Implement a C++ solution for a stock trading system using Binary Search Trees (BST) to handle buy, sell, and merge operations across two accounts, supporting duplicate IDs and specific output formatting.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill c-bst-trading-system-with-duplicates --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
