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

Algorithms, Data array A has data series from 1,000,000 to 1 with step size...

Data array A has data series from 1,000,000 to 1 with step size 1, which is in perfect decreasing order. Data array B has data series from 1 to 1,000,000, which is in random order.

Illustrate hls colour model, HLS Colour Model  This model has the doub...

HLS Colour Model  This model has the double-cone representation shown in Figure 3.40. The three colour parameters in this model are called hue (H), lightness (L), and Saturati

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

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

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

Complexity of an algorithm, Q. Explain the complexity of an algorithm?  Wha...

Q. Explain the complexity of an algorithm?  What are the worst case analysis and best case analysis explain with an example.

Methods, what is folding method?

what is folding method?

Complexity of an algorithm, An algorithm is a sequence of steps to solve a ...

An algorithm is a sequence of steps to solve a problem; there may be more than one algorithm to solve a problem. The choice of a particular algorithm depends upon following cons

Illustrate the wire frame representation, RENDERING, SHADING AND COLOURING ...

RENDERING, SHADING AND COLOURING By introducing hidden line removal we have already taken one step away from wire-frame drawings towards being able to realistically model and d

Implementation of stack using linked lists, In the last subsection, we have...

In the last subsection, we have implemented a stack by using an array. While a stack is implemented by using arrays, it suffers from the basic restriction of an array - i.e., its s

Comparisons between linear and binary search, Comparative Study of Linear a...

Comparative Study of Linear and Binary Search Binary search is lots quicker than linear search. Some comparisons are following: NUMBER OF ARRAY ELEMENTS EXAMINED array

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