How to take input for tree?(in C)

How do you program to take input for a tree?
For example if i have to give inorder traversal of a BST, for input
4(no of edges)
1-2,
1-3,
2-4,
2-5
How would i write the code create a tree from this input.
PS: In a newbie in tree question on codechef.
Thank you!!

You can use input just like you do for a graph, by creating a array of vector . for example if the number of vertices is n create vector tree[n+1] where tree[ i ] would denoted the edges of ith vertice .Can you share which question are talking about because some question give input like the above but some give parent of every element.