Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
FUNDAMENTALS: DATA STRUCTURES & ALGORITHMS SOME DEFINITIONS OF GRAPHS AND TREES GRAPH an ordered pair G = < V, E > where V is a finite non-empty set of vertices or nodes and E is a set of edges (unordered pair of vertices). The Order of the graph is the number of vertices; two distinct vertices are adjacent is joined by an edge; the degree of any vertex = number of edges incident on/away from it. DIRECTED GRAPH also known as a DIGRAPH or ORIENTED GRAPH where E defined above - the set of edges - is a set of ordered pairs from V (subset of V x V) PATH the sequence of edges (where consecutive edges share the same vertex) or vertices; path length is number of edges. SIMPLE PATH all vertices are distinct. CYCLE a path of length 3 or more which connects v0 with itself; simple cycle is a cycle whose path is simple. CONNECTED GRAPH every pair of vertices connected by at least one path. FREE TREE finite connected graph with no simple cycles. ORIENTED TREE some particular vertex designated as the root; remaining nodes, if any, partitioned into 1 or more disjoint sets, each being an oriented tree. LEVEL OF A VERTEX in an oriented tree by 'dangling' all n-1 vertices from the root we get levels defined as 1 plus the path from the root to vertex. We also get child, ancestor, sibling, internal/external nodes. ORDERED TREE finite set of one or more vertices, one designated the root and the remaining vertices partitioned in n >= 0 disjoint subsets each of which is an ordered tree. BINARY TREE finite set of vertices that is either empty or consists of a root and two binary subtrees which are disjoint and are called the left and right subtrees. FULL BINARY TREE a binary tree in which each node is either a leaf node or has exactly two non-empty descendants. COMPLETE BINARY TREE a binary tree with leaves on at most two adjacent levels and those located at the bottom most level lie in the leftmost position of the tree. PROPERTY OF TREES for a full binary tree: number of leaf nodes = number of internal nodes + 1