Deletion of an element from the linear array, Data Structure & Algorithms

Assignment Help:

Program will demonstrate deletion of an element from the linear array

/* declaration of delete_list function */

voiddelete_list(list *, int);

/* definition of delete_list function*/

/* Position of the element is specified by the user & the element is deleted from the list*/

voiddelete_list(list *start, int position)

{

int temp = position;

printf("\n information ought to remove:%d",l->data[position]);

while( temp <= start->count-1)

{

start->data[temp] = start->data[temp+1];

temp ++;

}

start->count = start->count - 1 ;

}

/* main function */

void main()

{

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

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

printf("\ninput the position of element you want to get rid of:");

scanf("%d", &position); fflush(stdin); delete_list(&l, position); traverse(&l);

}


Related Discussions:- Deletion of an element from the linear array

Circular linklist, write an algorithm to insert an element at the beginning...

write an algorithm to insert an element at the beginning of a circular linked list?

Expression trees, What are the expression trees? Represent the below writte...

What are the expression trees? Represent the below written expression using a tree. Give a relevant comment on the result that you get when this tree is traversed in Preorder,

Representation of a polynomial with a singly linked list, List areutilized ...

List areutilized to maintainPOLYNOMIALS in the memory. For example, we have a functionf(x)= 7x 5 + 9x 4   - 6x³ + 3x². Figure depicts the representation of a Polynomial by means o

Boar corloring, Board coloring , C/C++ Programming

Board coloring , C/C++ Programming

Steps of pre-order traversal, Pre-order Traversal The method of doing a...

Pre-order Traversal The method of doing a pre-order traversal iteratively then has the several steps(suppose that a stack is available to hold pointers to the appropriate nodes

Write an algorithm of value in tax using pseudocode, A town contains a tota...

A town contains a total of 5000 houses. Every house owner has to pay tax based on value of the house. Houses over $200 000 pay 2% of their value in tax, houses over $100 000 pay 1.

Minimum cost spanning trees, A spanning tree of any graph is only a subgrap...

A spanning tree of any graph is only a subgraph that keeps all the vertices and is a tree (having no cycle). A graph might have many spanning trees. Figure: A Graph

Define data model, Define data model?  A data model is a collection of ...

Define data model?  A data model is a collection of conceptual tools for explaning data, data relationships, data semantics and consistency constraints.

Construction of a binary tree , Q. Construct a binary tree whose nodes in i...

Q. Construct a binary tree whose nodes in inorder and preorder are written as follows: Inorder : 10, 15, 17, 18, 20, 25, 30, 35, 38, 40, 50 Preorder: 20, 15, 10

Data Structure, Ask consider the file name cars.text each line in the file ...

Ask consider the file name cars.text each line in the file contains information about a car ( year,company,manufacture,model name,type) 1-read the file 2-add each car which is repr

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