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

How to construct binary tree, Q. A Binary tree comprises 9 nodes. The preor...

Q. A Binary tree comprises 9 nodes. The preorder and inorder traversals of the tree yield the given sequence of nodes: Inorder :          E     A    C    K    F     H    D

Multiple queue, #questionalgorithm for implementing multiple\e queues in a ...

#questionalgorithm for implementing multiple\e queues in a single dimensional array

State the range of operation of abstract data type, State the range of oper...

State the range of operation of ADT Operations of the Range of T ADT includes following, where a, b ∈ T and r and s are values of Range of T: a...b-returns a range value (an

EM13845162, Do you have a library solution for this problem?

Do you have a library solution for this problem?

Implementation of dequeue, Dequeue (a double ended queue) is an abstract da...

Dequeue (a double ended queue) is an abstract data type alike to queue, where insertion and deletion of elements are allowed at both of the ends. Like a linear queue & a circular q

Sequential search of a list is preferred over binary search, What are the c...

What are the conditions under which sequential search of a list is preferred over binary search? Sequential Search is a preferred over binary search when the list is unordered

In order post order, illlustraate the construction of tree of a binary tree...

illlustraate the construction of tree of a binary tree given its in order and post order transversal

ERM, Hi, can you give me a quote for an E-R diagram

Hi, can you give me a quote for an E-R diagram

Determine about the push operation, Determine about the push operation ...

Determine about the push operation A Container may or may not be accessible by keys, so it can't make assumptions about element retrieval methods (for example, it cannot have a

Explain backtracking, Explain Backtracking The  principal idea is to co...

Explain Backtracking The  principal idea is to construct solutions single component  at a time  and evaluate such  partially constructed candidates as follows. If a partiall

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