Abstract data type-list, Data Structure & Algorithms

Assignment Help:

It is a useful tool for indicating the logical properties of data type. It is a collection of values & a set of operations on those values. Methodically, "a TYPE is a set, & elements of set are Values of that type".

ADT List

A list of elements of type T is finite sequence of elements of type T together with the operations of, update, create,delete, testing for full,testing for empty, finding the size, traversing the elements.

In defining Abstract Data Type, we are not concerned with time or space efficiency as well as regarding implementation details. The elements of a list might be characters,integers, real numbers & combination of multiple data types.

Consider a real world problem, where we have a company and we want to store the details of employees. To store the details, we need a data type which can store the type details containing the name of employee, date of joining etc. The list of employees may increase depending on the recruitment and may decrease on retirements or termination of employees. For making it simple and for better understanding purpose, we are only taking the name of employee field and ignoring the date of joining etc. The operations we must perform on this list of employees are creation, insertion, deletion, visiting, etc. We described employee_list as

typedefstruct

{

char   name[20];

...................

......................

}  emp_list;

The Operations on emp_list can be defined as

Create_emplist (emp_list   * emp_list )

{

/* we will be writing create function by taking help of 'C' programming language, here */

}

The list has been created & name is a valid entry in emplist, & position p specifies the position in the list where name must inserted insert_emplist (emp_list   * emp_list ,   char      *name, int position  )

{

/* we will be writing insert function by taking help of 'C' programming language,Here */

}

delete_emplist (emp_list   * emp_list,    char      *name)

{

/* we will be writing delete function by taking help of 'C' programming language,Here */

}

visit_emplist (emp_list   * emp_list )

{

/* we will be writing visit function through taking help of 'C' programming language,here */

}

The list can be implemented through two ways: the contiguous (Array) implementation & the linked (pointer) implementation. In the contiguous implementation, the entries into the list are stored next to each other into an array. The linked list implementation uses pointers & dynamic memory allocation.


Related Discussions:- Abstract data type-list

Define queue, A queue is a, FIFO (First In First Out) list.

A queue is a, FIFO (First In First Out) list.

Define midsquare method, Midsquare Method :- this operates in 2 steps. In t...

Midsquare Method :- this operates in 2 steps. In the first step the square of the key value K is taken. In the 2nd step, the hash value is obtained by deleting digits from ends of

Define about the inheritance hierarchy, Define about the inheritance hierar...

Define about the inheritance hierarchy Languages Eiffel and D provide constructs in language for invariants and pre- and post conditions which are compiled into the code and ar

Nothing, c++ To calculate the amount to be paid by a customer buying yummy ...

c++ To calculate the amount to be paid by a customer buying yummy cupcakes for his birth day party

Name the four data type groups, There are four data type groups:  I...

There are four data type groups:  Integer kepts whole numbers and signed numbers Floating-point Stores real numbers (fractional values). Perfect for storing bank deposit

What is a spanning tree of a graph, What is a Spanning tree of a graph? ...

What is a Spanning tree of a graph? A Spanning Tree is any tree having of vertices of graph tree and some edges of graph is known as a spanning tree.

Binary search trees, In this unit, we discussed Binary Search Trees, AVL tr...

In this unit, we discussed Binary Search Trees, AVL trees and B-trees. The outstanding feature of Binary Search Trees is that all of the elements of the left subtree of the root

Perfect matching polytope ppm, Let G=(V,E) be a graph for which all nodes h...

Let G=(V,E) be a graph for which all nodes have degree 5 and where G is 5-edge is connected. a) Show that the vector x which is indexed by the edges E and for which xe = 1/5 for

What is the best case complexity of quick sort, What is the best case compl...

What is the best case complexity of quick sort In the best case complexity, the pivot is in the middle.

Deletion of a node from an avl tree, For AVL trees the deletion algorithm i...

For AVL trees the deletion algorithm is a little more complicated as there are various extra steps involved in the deletion of node. If the node is not a leaf node, then it contain

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