1
- is a tree as you can take , or as a root node and can arrange everything to descend from the node.
- is a tree as you can take , , or as a root node.
- is not a tree as there is a cycle formed:
- is not a tree as there are two disjoint simple graphs.
title: Correct answers.
Could use different terminology though, say, "$G_1$ and $G_2$ are each connected and contains no simple cycles so it is a tree."2
- Root is
- Internal vertices are:
- Leaves are
- Children of are:
- Parent of is
- Sibling of is
- Ancenstors of are
- Descendants of are
title: Correct answers.3
No, say it was a full tree, satisfies this by having children but only has children so it can’t be a full tree.
title: Correct answer.4
Basis Step: Take a tree with vertices, it is just the root so we know that it doesn’t have any edges, according to the statement, it should have edges which is correct.
Inductive Step: Assume that for , every tree with vertices has edges.
Now try to prove this for , lets assume we already have a graph which has vertices, now we add another vertex, make it the root and make the root of the child of this new vertex. By IH, we know that the number of edges of is , but we also know that since we just added our new root vertex, there is now a new edge between our root and ‘s original root.
Hence, the number of edges is now , which is or otherwise . This is the IH with .
graph G {
node[shape=point]
0[xlabel="new vertex / root"]
0--1
subgraph cluster0 {
label=" T"
1[xlabel="root "]
1--2,3
2--4,5
3--6,7
}
}Hence by mathematical induction, for all positive integers , every tree with vertices has edges.
title: Correct answer.5
-
It is a simple graph but it is cyclic, hence not a tree.
graph G { 1--3,5 2--4,5 3--4 }title: Correct answer. -
It is a simple graph and has no simple cycles, hence it is a tree.
graph G { 1--2 2--3,5 3--4 }title: Correct answer. -
It is a simple graph with no cycles, hence it is a tree.
graph G { 1--2 2--3 3--4 }title: Graph is not connected hence not a tree. ```graphviz graph G { 1--2 2--3 3--4 5 }
6
-
Full binary tree having 4 internal vertices and five leaves.
graph G { node[shape=point] 0--l,r l--aa l--1 1--bb 1--2 2--cc,dd }title: Correct answer. -
Full binary tree of height 3 and having nine leaves. is not possible, as the maximum is eight leaves
title: Correct answer.graph G { node[shape=point] 0--1,2 1--3,4 3--5,6 4--7,8 2--9,10 9--11,12 10--13,14 } -
Full binary tree of height having nine leaves.
graph G { node[shape=point] 0--1,2 1--3,4 3--5,6 4--7,8 2--9,10 9--11,12 10--13,14 14--15,16 }title: Correct answer.
7
graph G {
graph [nodesep="0.6"]
node[shape=plain]
1[label="∨"]
2[label="∧"]
3[label="¬"]
4[label="q"]
5[label="¬"]
6[label="p"]
7[label="↔"]
8[label="q"]
9[label="¬"]
10[label="p"]
1--2,3
3--4
2--5,7
5--6
7--8,9
9--10
}title: Correct answer.8
graph G {
layout=neato
graph[nodesep="0.6"]
node[shape=plain]
15[pos="0,0!"]
3[pos="-1,-1!"]
627[pos="1,-1!"]
410[pos="0, -2!"]
512[pos="1,-3!"]
626[pos="2,-4!"]
15--3,627
627--410
410--512
512--626
}- To locate or add , comparisons are needed.
- To locate or add , comparisons are needed.
title: Correct answers.9
- Pre-order:
- In-order:
- Post-order:
title: Partially correct.
In-order is incorrect, should be $e,b,l,f,m,n,a,g,c,o,h,p,i,d,s,q,u,t,j,r,k$