We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
If we have a tree of n nodes, how many edges will it have?
I answered (n*n-1)/2 but the system is showing wrong answer. Number of edges in a tree is nC2. Why it is showing wrong?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Data Structures MCQ 1
You are viewing a single comment's thread. Return to all comments →
If we have a tree of n nodes, how many edges will it have? I answered (n*n-1)/2 but the system is showing wrong answer. Number of edges in a tree is nC2. Why it is showing wrong?