# 2.8.10 - Splay Tree

調整過程較AVL Tree簡單。

Splay Tree是一個Binary Search Tree，其search()/insert()/delete()的運作皆和Binary Search Tree相同，差別在於在做完每一個運算之後必須針對splay起點執行splay運算，將splay起點變成root。

Splay起點:

1. search(x): splay起點為x
2. insert(x): splay起點為x
3. delete(s): splay起點為x的附點

Splay運算:

* 2個節點

![](https://2769815795-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGckN3OAfinKuVIrkMj%2F-LHvkbf1Unpss3gUwuW1%2F-LHvkoFGFeryVOoPwx-g%2F%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7%202018-07-21%2015.30.22.jpg?alt=media\&token=15d114ad-d74d-448a-9bec-710b78ec5cf8)

![](https://2769815795-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGckN3OAfinKuVIrkMj%2F-LHvkbf1Unpss3gUwuW1%2F-LHvkpqLdfXkDUuEn-qr%2F%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7%202018-07-21%2015.31.35.jpg?alt=media\&token=f418c753-25be-4521-92fe-63a3e854ee9f)

* 3個節點

![](https://2769815795-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGckN3OAfinKuVIrkMj%2F-LHvlI-SP3hnqNOm4Z7J%2F-LHvlSDqHUa9LUqRHgtt%2F%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7%202018-07-21%2015.37.33.jpg?alt=media\&token=6ace57f7-712c-4d7f-b9f9-cf8618dc5fa3)

![](https://2769815795-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGckN3OAfinKuVIrkMj%2F-LHvm1mFXWmMyeICa67b%2F-LHvm2z21sEIQLPNiWyx%2F%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7%202018-07-21%2015.40.08.jpg?alt=media\&token=7ca054d0-8e70-4c66-a469-ab360957ff18)

![](https://2769815795-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGckN3OAfinKuVIrkMj%2F-LHvmRkrBKQ_myCJ3H3i%2F-LHvmTaW30uPtAmySSfa%2F%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7%202018-07-21%2015.41.55.jpg?alt=media\&token=77668751-7873-495d-b0c3-0b073dcdb5aa)

![](https://2769815795-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGckN3OAfinKuVIrkMj%2F-LHvmRkrBKQ_myCJ3H3i%2F-LHvmmbd71uebi8LXChj%2F%E8%9E%A2%E5%B9%95%E5%BF%AB%E7%85%A7%202018-07-21%2015.43.24.jpg?alt=media\&token=b336abea-2d86-4318-96f3-aaa56666de76)


---

# 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://garychang.gitbook.io/data-structure/lecture2-tree-and-binary-tree/lecture-2.8-advanced-trees/2.8.10-splay-tree.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.
