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

Darw a flowchart that inputs country someone is visiting, Regis lives in Br...

Regis lives in Brazil and frequently travels to USA, Japan and Europe. He wants to be able to convert Brazilian Reais into US dollars, European euros and Japanese yen. Conversion f

Describe commonly used asymptotic notations, Q.1 Compare two functions n 2 ...

Q.1 Compare two functions n 2 and 2 n for various values of n. Determine when second becomes larger than first. Q.2 Why do we use asymptotic notation in the study of algorit

Algorithm of decorated graph, As we talked in class, a program with two int...

As we talked in class, a program with two integer variables is universal. Now, we consider a special form of four variableprograms. Let G = (V; E) be a directed graph, where V is a

Show that towers of hanoi is o (2n), Question 1 Discuss the advantages of ...

Question 1 Discuss the advantages of implementation checks preconditions Question 2 Write a ‘C' program to search for an item using binary search Question 3 Show that To

Explain the representations of graph, Explain the representations of graph....

Explain the representations of graph. The different ways of representing a graph is: Adjacency list representation : This representation of graph having of an array Adj of

Algorithm for finding a key by binary search technique, Q. Write down an al...

Q. Write down an algorithm for finding a key from a sorted list using the binary search technique or method.

System defined data types, System defined data types:- These are data t...

System defined data types:- These are data types that have been defined by the compiler of any program. The C language contains 4 basic data types:- Int, float,  char and doubl

Physical database design and sql queries, In this part, students are allowe...

In this part, students are allowed to implement the following simplifications in their table and data design. o Availability for the beauty therapists don't have to be considere

Explain best - fit method, Best - Fit Method: - This method obtains the sma...

Best - Fit Method: - This method obtains the smallest free block whose  size is greater than or equal to get such a block by traversing the whole free list follows.

Algorithms, 2. Write a note on i) devising ii) validating and...

2. Write a note on i) devising ii) validating and iii) testing of algorithms.

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