Abstract data type-list, Data Structure & Algorithms

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.

Posted Date: 4/11/2013 2:46:13 AM | Location : United States







Related Discussions:- Abstract data type-list, Assignment Help, Ask Question on Abstract data type-list, Get Answer, Expert's Help, Abstract data type-list Discussions

Write discussion on Abstract data type-list
Your posts are moderated
Related Questions
perform the following length operation LENGTH("welcome to ICA")=

Data Structure and Algorithm 1. Explain linked list and its types. How do you represent linked list in memory? 2. List and elucidate the types of binary tree. 3. Descr

Complexity is the rate at which the needed storage or consumed time rise as a function of the problem size. The absolute growth based on the machine utilized to execute the program

Explain about the Structured types - Built-In Types Values of the carrier set are not atomic, consisting rather than several atomic values arranged in some way. Common illu

Abstract data type The thing which makes an abstract data type abstract is that its carrier set and its operations are mathematical entities, like geometric objects or numbers;

According to this, key value is divided by any fitting number, generally a prime number, and the division of remainder is utilized as the address for the record. The choice of s

compare and contrast the bubble sort,quick sort,merge sort and radix sort

Binary tree creation struct NODE { struct NODE *left; int value; struct NODE *right; }; create_tree( struct NODE *curr, struct NODE *new ) { if(new->val

Materials consumed are priced in a systematic and realistic manner. It is argued that current acquisition costs are incurred for the purpose of meeting current production and sales

Q. The degree of a node is defined as the number of children it has. Shear show that in any binary tree, the total number of leaves is one more than the number of nodes of degree 2