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

Insertion of a node into a binary search tree, A binary search tree is cons...

A binary search tree is constructed through the repeated insertion of new nodes in a binary tree structure. Insertion has to maintain the order of the tree. The value to the lef

Depth First Search Through Un-weighted Connected Graph , Q. Write down the ...

Q. Write down the algorithm which does depth first search through an un-weighted connected graph. In an un-weighted graph, would breadth first search or depth first search or neith

Searhing and sorting algorithms, how I can easily implement the bubble,sele...

how I can easily implement the bubble,selection,linear,binary searth algorithms?

Array, how to define the size of array

how to define the size of array

Graphs with negative edge costs, We have discussed that the above Dijkstra'...

We have discussed that the above Dijkstra's single source shortest-path algorithm works for graphs along with non-negative edges (like road networks). Given two scenarios can emerg

Define about the class invariant, Define about the class invariant A cl...

Define about the class invariant A class invariant may not be true during execution of a public operation though it should be true between executions of public operations. For

Complexity of an algorithm, compare two functions n and 2n for various valu...

compare two functions n and 2n for various values of n. determine when second becomes larger than first

File organization, Define File organization''s and it''s types

Define File organization''s and it''s types

Brute force, Determine the number of character comparisons made by the brut...

Determine the number of character comparisons made by the brute-force algorithm in searching for the pattern GANDHI in the text

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