Can anyone help to to create a binary tree and do a non recursive preorder traversal of the binary tree in c?


Question: Using limits to prove a function is in the order of another function
Answer: $$\lim_{n \to +\infty} \frac{g(n)}{f(n)}=c$$ 
means that $\forall \epsilon&gt;0, \exists n_0 \in \mathbb{N}$ such that $\forall n \geq n_0:$
$$\left |\frac{g(n)}{f(n)}-c \right | &lt; \epsilon \Rightarrow - \epsilon&lt; \frac{g(n)}{f(n)}-c&lt; \epsilon \Rightarrow c- \epsilon&lt; \frac{g(n)}{f(n)}&lt;c+\epsilon \\ \Rightarrow (c-\epsilon)f(n)&lt; g(n)&lt;(c+\epsilon) f(n)$$

We pick $\epsilon=\frac{c}{2}$ and we have that $\forall n \geq n_0:$

$$\frac{c}{2} \cdot f(n)&lt; g(n)&lt; \frac{3c}{2} \cdot f(n)$$

Now pick $c_1=\frac{c}{2}, c_2=\frac{3c}{2}$ and you will see that this is the definition of $g(n)=\Theta(f(n))$.