2022 Developer Survey is open! Take survey.

# Tag Info

1 vote

### Find a string between two groups A,B that have an amount of smaller strings in A as it has larger strings in B

Your idea to use a trie is good. I think that what might do the trick is only to store additionnal information at each node: the number of strings of $A$ and of $B$ contained in the corresponding ...

### Inorder Traversal of the Ternary Tree

A tree is a finite set of one or more nodes such that there is one specially designated node called the root node of the tree, and the remaining nodes are partitioned into trees $T_1,\ldots,T_k$ (...

### I think I have discovered a new sorting algorithm using binary search tree

Nice work, but not useful because trees are not really sorted (in the sense of a sorted array) as the nodes may be stored non-contiguously in memory, and you need to follow the links; any BST is ...
Accepted

### Proving that the number of leaves in a tree >= number of unmatched vertices

Prove it by induction. It is true for trees with |V|<=3. Suppose that it is true for trees with |V|=n-1 and we want to prove it for a tree T with |V|=n. If there exist a leaf v which is unmatched ...
First, note that if $T$ is an $\alpha$-good tree, then for any node $x$ with children $y$ and $z$, without loss of generality, $|y| \leqslant |z| <\frac{1+\alpha}2 |x|$. Now consider $h_n$ the ...