# CSAW CTF Qualifiers 2018

## Bin\_t - Misc \[50 pts] <a href="#bin_t" id="bin_t"></a>

> Binary trees let you do some interesting things. Can you balance a tree?
>
> nc misc.chal.csaw\.io 9001
>
> Equal nodes should be inserted to the right of the parent node. You should balance the tree as you add nodes.

{% file src="/files/-MdrONtFyX1PS1h0X1dF" %}
AVL
{% endfile %}

It inserted all the nodes into an AVL tree and did a preorder traversal

**Flag: flag{HOW\_WAS\_IT\_NAVIGATING\_THAT\_FOREST?}**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://codingmace.gitbook.io/masterward/ctf/2018/csaw-2018.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
