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

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);


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

Related Discussions:- Deletion of an element from the linear array, Assignment Help, Ask Question on Deletion of an element from the linear array, Get Answer, Expert's Help, Deletion of an element from the linear array Discussions

Write discussion on Deletion of an element from the linear array
Your posts are moderated
Related Questions
how to write a pseudo code using Kramer''s rule

Step 1: Choose a vertex in the graph and make it the source vertex & mark it visited. Step 2: Determine a vertex which is adjacent to the source vertex and begun a new search if

Explain Space Complexity Space Complexity :- The space complexity of an algorithm is the amount of memory it requires to run to completion. Some of the reasons to study space

Tree is dynamic data structures. Trees can expand & contract as the program executes and are implemented via pointers. A tree deallocates memory whereas an element is deleted.

adjacency multilist

Example: (Double left rotation while a new node is added into the AVL tree (RL rotation)) Figure: Double left rotation when a new node is inserted into the AVL tree A

Regis lives in Brazil and frequently travels to USA, Japan and Europe. He wants to be able to convert Brazilian Reais into US dollars, European euros and Japanese yen. Conversion f

Binary search technique:-  This technique is applied to an ordered list where elements are arranged either in ascending order or descending order. The array is separated into t

State in detail about the Integer Carrier set of the Integer ADT is the set {..., -2, -1, 0, 1, 2, ...}, and  operations on these values are addition, multiplication, subtrac