Return the root of a balanced binary search tree populated with the values in iterable *iseq*.
(cls, iseq)
| 143 | |
| 144 | @classmethod |
| 145 | def from_ordered_sequence(cls, iseq): |
| 146 | """ |
| 147 | Return the root of a balanced binary search tree populated with the |
| 148 | values in iterable *iseq*. |
| 149 | """ |
| 150 | seq = list(iseq) |
| 151 | # optimize for usually all fits by making longest first |
| 152 | bst = cls(seq.pop()) |
| 153 | bst._insert_from_ordered_sequence(seq) |
| 154 | return bst |
| 155 | |
| 156 | def insert(self, value): |
| 157 | """ |