Fully explained questions for Discrete Mathematics

Arinda Iradi
As our mission states we aim at providing quality educational resources  that improves the level  understanding .
Here are questions for Discrete Math
QUESTION ONE
Using examples, explain the concepts of Euler and Hamilton paths as used in graph theory.

QUESTION TWO
With the help of examples and clear illustrations, explain the following tree Traversal Algorithms;
In-order
Pre-order
Post order


SOLUTIONS

QUESTION ONE

An Euler path is a path in a graph that traverses every edge exactly once, but doesn’t necessarily return to the starting point.
 
Given an example 1: consider a graph with vertices A, B, C, and D and edges connecting them such that it forms a cycle ABCDA, this graph has an Euler path because you can traverse each edge exactly once, forming the path ABCDAB.

 Example 2: consider a graph with vertices A, B, C, D, E and F and edges AB, BC, CD, DE, EF, and FA. This graph forms a cycle ABCDEFA. An Euler path for this graph could be ABCDEFAD, where each edge is traversed exactly once.

Euler paths have applications in various areas such as network analysis, circuit design and optimization problems.

A Hamilton path is a path in a graph that visits every vertex exactly once.

Example 1: in the graph with vertices A, B, C, and D, and edges connecting them in such way that there is a path from A to B, B to C, C TO D, and D TO E, a Hamilton path for this graph could be ABCDE, where each vertex is visited exactly once.

Example 2: imagine a graph with vertices A, B, C, D and E, and edges connecting them in such a way that there is a path from A to B, B to C, C to D and D to E, and also a direct edge from A TO E, A Hamilton path for this graph could be ABCDECA, where each vertex is visited only once.
                               Hamilton paths are used in travelling salesman problem and network routing.


QUESTION TWO

In-order traversal. In this traversal, the modes are visited in the order of left child, root and then the right child. It is commonly used in binary search trees to visit nodes in non-decreasing order.

Illustration
       1
      /  \
2         3           here the nodes are visited as 4, 2, 5,1, 6, 3, 7
                 /  \       /  \
      5    6     7
Pre-order traversal, involves visiting nodes in the order of a root, left child and then right child. This transversal is useful for creating a prefix notation of an expression n tree.

Illustration
                 1
                /   \
               2        3            the pre-order traversal is 1, 2, 4, 5, 3, 6, 7
            /     \      /  \
         4          5   6   7   
         
Post-order.  Here nodes are visited in the order of left child, right child and then root. This traversal method is commonly used in evaluating post-fix expressions.

Illustration
             1
           /     \
         2          3          the post-order traversal of the tree is 4, 5, 2, 6, 7, 3, 1
        /  \      /  \
     4     5     6   7
Tags
  • Newer

    Fully explained questions for Discrete Mathematics