Abstract data type-tree, Data Structure & Algorithms

Assignment Help:

Definition: A set of data values & related operations that are accurately specified independent of any particular implementation.

As the data values and operations are described with mathematical precision, instead of as an implementation in a computer language, we might reason about effects of the operations, relationship to other abstract data types, whether a programming language implements the particular data type, etc.

Regard the given abstract data type:

Structure data tree

type Tree = nil | fork (Element , Tree , Tree)

Operations:

null : Tree -> Boolean leaf : Tree -> Boolean

fork : (Element , Tree , Tree) -> Tree

left : Tree -> Tree                 // It illustrated the properties of tree that left of a tree is also a tree.

right: Tree -> Tree contents: Tree -> Element height (nil) = 0 |

height (fork(e,T,T')) = 1+max(height(T), height(T'))

weight (nil) = 0 |

weight (fork(e,T,T')) = 1+weight(T)+weight(T')

2310_ABSTRACT DATA TYPE-TREE.png                       

 Figure: A binary tree


Related Discussions:- Abstract data type-tree

B-tree, Unlike a binary-tree, each node of a B-tree may have a number of ke...

Unlike a binary-tree, each node of a B-tree may have a number of keys and children. The keys are stored or saved in non-decreasing order. Each key has an related child that is the

Explain b- tree, B- Tree  A B-tree of order m is an m-way true in which...

B- Tree  A B-tree of order m is an m-way true in which  1)  All leaves are on the similar level 2)  All internal nodes except the root have at most m-1(non-empty) childre

Write an algorithm for binary search., Write an algorithm for binary search...

Write an algorithm for binary search. Algorithm for Binary Search 1.  if (low> high) 2.  return (-1) 3.  Mid = (low + high)/2 4.  if ( X = = a[mid]) 5.  return (mid); 6.

Process of analysis, The objective analysis of an algorithm is to determine...

The objective analysis of an algorithm is to determine its efficiency. Efficiency is based on the resources which are used by the algorithm. For instance, CPU utilization (Ti

Name the five popular hashing functions, Five popular hashing functions are...

Five popular hashing functions are as follows: 1) Division Method 2) Midsquare Method 3) Folding Method 4) Multiplicative method 5) Digit Analysis

Define a tree and list its properties, QUESTION (a) Define a tree and l...

QUESTION (a) Define a tree and list its properties. (b) By showing all your workings, draw the spanning tree for the following graph based on the Breadth-First-Search algori

What is a container taxonomy, What is A Container Taxonomy It's useful ...

What is A Container Taxonomy It's useful to place containers in a taxonomy to help understand their relationships to one another and as a basis for implementation using a class

Linked list, how to creat atm project by using linked list?

how to creat atm project by using linked list?

Two-dimensional array, Two-dimensional array is shown in memory in followin...

Two-dimensional array is shown in memory in following two ways:  1.  Row major representation: To achieve this linear representation, the first row of the array is stored in th

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd