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

Explain the linked list implementation of stack, Question 1 Explain the fo...

Question 1 Explain the following? Arrays Stack Trees Question 2 Explain the Linked list implementation of stack Question 3 What is a binary tree? Expla

Example of telephone directory, A telephone directory having n = 10 records...

A telephone directory having n = 10 records and Name field as key. Let us assume that the names are stored in array 'm' i.e. m(0) to m(9) and the search has to be made for name "X"

State the example of pre- and post-conditions, State the example of pre- an...

State the example of pre- and post-conditions Suppose that function f(x) should have a non-zero argument and return a positive value. We can document these pre- and post-condit

Algorithsm, What are the properties of an algorithsm?

What are the properties of an algorithsm?

Sorting, Retrieval of information is made simpler when it is stored into so...

Retrieval of information is made simpler when it is stored into some predefined order. Therefore, Sorting is a very important computer application activity. Several sorting algorit

What is binary space partition, Binary Space Partition A binary space-p...

Binary Space Partition A binary space-partitioning (BSP) tree is an efficient method for determining object visibility by painting surfaces onto the screen from back to front,

Preliminaries, Think of a program you have used that is unacceptably slow. ...

Think of a program you have used that is unacceptably slow. Identify the specific operations that make the program slow. Identify other basic operations that the program performs q

BST has two children, If a node in a BST has two children, then its inorder...

If a node in a BST has two children, then its inorder predecessor has No right child

Sorting algorithm for singly linked lists, Q. Which sorting algorithm can b...

Q. Which sorting algorithm can be easily adaptable for singly linked lists? Explain your answer as well.        Ans: The simple Insertion sort is sim

Algo for quicksort, Easy algorithm for beginner for quicksort with explanat...

Easy algorithm for beginner for quicksort with explanation

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