TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tutosrive/avl_tree_car/llms.txt
Use this file to discover all available pages before exploring further.
/avl routes are the primary HTTP interface for managing the AVL tree’s obstacle nodes. Every mutating operation triggers a rebalance of the self-balancing binary search tree on the server, keeping obstacle lookups efficient regardless of insertion order. All routes support an optional trailing slash and accept Content-Type: application/json on POST requests.
GET /avl
Returns a welcome message confirming the AVL section is reachable. No request body. Response 200POST /avl/node/add
Inserts a new obstacle node into the AVL tree at road coordinates(x, y). If a node at those coordinates already exists the server rejects the request with 400.
Request body
Horizontal road position of the obstacle (float).
Vertical position / height of the obstacle (float).
Obstacle type identifier. Must correspond to a valid entry in the obstacle types list (integers 1–10). See GET /data/json/obstacles_types.json for the full catalogue.
Responses
200 on success, 400 if the node already exists, 500 on a server exception.true when the obstacle was inserted successfully.On success:
"The node with coordinates (x, y) has been added successfully!" — with the actual coordinate values substituted. On failure: a human-readable reason.The generated obstacle ID (an 8-character random string) on success;
{} on failure.null on success; exception message on a 500 error.curl example
The
data field on a successful insertion holds the auto-generated obstacle ID. Store this value if you need to reference the obstacle later.POST /avl/node/remove
Deletes the obstacle node located at(x, y) from the AVL tree and rebalances the tree automatically. The server constructs an Obstacle object from the body to locate the node; the search is performed by coordinates.
Request body
Horizontal road position of the obstacle to remove.
Vertical position of the obstacle to remove.
Obstacle type ID used to construct the
Obstacle object. The tree search is performed by (x, y) coordinates only, so this value does not need to match the stored node’s type_id.Responses
200 on success, 400 if the node was not found or removal failed, 500 on a server exception.true when the obstacle was removed and the tree was rebalanced."Obstacle removed!" on success; a descriptive failure message otherwise.{} — no payload is returned on removal.null on success; exception message on a 500 error.curl example
POST /avl/add/configs
Validates and bulk-inserts a full simulation configuration that includes multiple obstacles at once. The server checks required keys before any insertion; if validation passes, each obstacle is inserted individually and only successfully inserted IDs are returned. If all insertions fail (e.g., all nodes are duplicates), the endpoint returns400.
Request body
The body must contain two top-level keys:configs and obstacles.
Simulation-level settings. Must include:
total_distance— total road distance for the simulation runjump_height— maximum jump height allowed for the car
Array of obstacle objects. Each element must include:
x— horizontal position (float)y— vertical position (float)type— obstacle type name string (e.g."Rock")
Minimal example body
Responses
200 on success, 400 on validation failure or if every obstacle insertion was rejected.true when at least one obstacle was inserted successfully."The configurations has been added succesfully!" on success; "There are some errors in the sent data!" on a validation failure.Array of auto-generated obstacle IDs for every successfully inserted node. Nodes that were already present in the tree are silently skipped and not included.
null on success; a validation error description on 400.