answersLogoWhite

0


Best Answer

Stack is an abstract data type that allows you to input and output data in a way that the first data which was placed in the stack will be the last one to get out. We use physical examples of stack in our daily lives such as the stack of dishes or stack of coins where you only add or remove objects from the top of the stack.

You can see the whole source code implementing the stack in related links, below.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

//Doubly linked list:

#include<stdio.h>

#include<conio.h>

#include<alloc.h>

# define NULL 0

typedef struct list

{

int data;

struct list *next;

struct list *prev;

}node;

node *head = NULL;

node *prev = NULL;

node* create_node()

{

node *new1;

new1 = malloc(sizeof(node));

printf("\nEnter data:");

scanf("%d",&new1->data);

new1->next = NULL;

new1->prev = NULL;

return(new1);

}

void insert_beg()

{

node *new1;

if(head 1)

insert_beg();

else

insert_after();

break;

case 3: search();

break;

case 4: display();

break;

case 5: printf("\nEnter the data to be found");

scanf("%d",&x);

find_prev(x);

break;

case 6: deletion();

break;

case 7: exit(0);

}

printf("\n\n");

}while(ch != 7);

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

The Standard Template Library (STL) provides a linked list implementation in the "list" header. Its API is all over the internet.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Programs to implement operations on doubly linked list in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How can implement round robin sceduler in java using circular doubly linked list?

I'm sorry brother


C program to implement deque using circular linked list?

You'll need to use a doubly-linked circular list, since otherwise when you pop off the tail element you'll need to whizz all the way round the list to find its predecessor. See the links section for an implementation of a doubly-linked circular list.


Does each node in a doubly linked list contain a link to the previous as well as the next node?

Yes, each node in a doubly linked list contain a link to the previous as well as the next node. That is the definition of the doubly linked list.


Convert single linked list to double linked list?

You copy a singly linked list into a doubly linked list by iterating over the singly linked list and, for each element, calling the doubly linked list insert function.


what are the differences between singly link list and doubly link list?

singly linked list stores only the address of next node while doubly linked list stores the address of previous node and next node and hence it is called doubly linked list. In singly linked list only forward traversing is possible while in doubly linked list forward and backward traversal is possible.


What is the difference between doubly linked list and circular linked list?

A doubly linked list allows traversal in both directions (forward and backward) by having each node point to both its next and previous nodes. A circular linked list is a type of linked list where the last node points back to the first node, forming a circular structure. This allows continuous traversal through the elements without a definitive end.


Implement dequeue using doubly linked list?

if (this-&gt;next) this-&gt;next-&gt;prev= this-&gt;prev; else list-&gt;last= this-&gt;prev; if (this-&gt;prev) this-&gt;prev-&gt;next= this-&gt;next; else list-&gt;first= this-&gt;next; free (this);


How do you write a Java program to implement weighted queue using circular doubly linked list?

Add weights to the elements of the queue and use an algorithm to sort the queue every time an element is added.


Write a algorithm for doubly linked list in c?

sorry


Which operation is perform more efficiently by doubly linked list than by single linked list?

zsd


What is the advantage of doubly linked list over Doubly linked list?

A doubly linked list can be traversed in both directions (forward and backward). A singly linked list can only be traversed in one direction. A node on a doubly linked list may be deleted with little trouble, since we have pointers to the previous and next nodes. A node on a singly linked list cannot be removed unless we have the pointer to its predecessor. On the flip side however, a doubly linked list needs more operations while inserting or deleting and it needs more space (to store the extra pointer).


What is meant by doubly linked list?

In C programming, a double linked-list refers to a linked data structure that contains a set of links that have been linked sequentially.