# Chef Learns BST SOLUTIONS ECAUG204

Page Contents

### Chef Learns BST SOLUTIONS ECAUG204

Cook has been given elite of N whole numbers and was approached to make a Binary Search Tree having N hubs. Be that as it may, Chef was occupied with cooking so he requested your assistance. Culinary expert gave you those numbers and inquired as to whether it is conceivable to shape the necessary Binary Search Tree.

Parallel Search Tree (BST) is a hub based twofold tree information structure which has the accompanying properties:

The left subtree of a hub contains just hubs with keys lesser than the hub’s vital.

The privilege subtree of a hub contains just hubs with keys more noteworthy than the hub’s vital.

The left and right subtree each must likewise be a paired inquiry tree.

Information:

First line will contain T, number of testcases. At that point the testcases follow.

First line of each testcase contains of a solitary line of information, a whole number N.

Next line contains N space isolated whole numbers.

Yield:

For each testcase, yield “Yes” in the event that it is conceivable to make the BST else “No” (without ” “).

Limitations

1≤T≤100

1≤N≤104

1≤Ai≤105

Test Input:

1 2 3

Test Output:

Truly

Clarification:

Since we can shape a BST as follows: 1 3