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

Algorithm for binary search, Q. Write down the algorithm for binary search....

Q. Write down the algorithm for binary search. Which are the conditions under which sequential search of a list is preferred over the binary search?

Efficient algorithms.., implementation of fast fourier transforms for non p...

implementation of fast fourier transforms for non power of 2

Stack, write pseudocode to implement a queue with two stacks

write pseudocode to implement a queue with two stacks

Prims algorithm, how to implement prims algorithm dynamically

how to implement prims algorithm dynamically

General, whats the definition of ADT and data type?

whats the definition of ADT and data type?

Merge sort, #question. merging 4 sorted files containing 50,10,25,15 record...

#question. merging 4 sorted files containing 50,10,25,15 records will take time?

Define the terms - key attribute and value set, Define the terms   ...

Define the terms     i) Key attribute     ii) Value set  Key attribute:  An entity  type  usually  has  an attribute  whose  values  are  distinct  fr

General Tree, How to create an General Tree and how to search general tree?...

How to create an General Tree and how to search general tree?

Difference between array and abstract data types, Difference between array ...

Difference between array and abstract data types Arrays aren't abstract data types since their arrangement in the physical memory of a computer is an essential feature of their

List various problem solving techniques, List various problem solving techn...

List various problem solving techniques. There are two techniques:- 1.  Top down 2.  Bottom- up

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