EmbLogic's Blog

Header file for double linklist : (All functions implemented except for a few in the misc menu)

1 #include<stdio.h>
2 #include<stdlib.h>
3
4 struct node
5 {
6         int info;
7         struct node *next;
8         struct node *prev;
9 };
10
11
12 void mem_fail();                          // report failure of memory allocation and exit the program.
13 void traverse(struct node *);             // traverse the linklist, given the start node.
14 int search(struct node *);
15 struct node *get_node();                  // return a new node to the caller.
16 struct node *op_menu(struct node *, int); // maps the choice of the user to its corresponsing operation on the linklist.
17 struct node *insert_menu(struct node *);  // contains the different options for the insertion of a node in  the linklist.
18 struct node *insert(struct node *, int);  // maps the user choice for inserting a node to its corresponding function.
19 struct node *insert_end(struct node *, struct node *);
20 struct node *insert_beg(struct node *, struct node *);
21 struct node *insert_at_pos(struct node *, struct node *);
22 struct node *insert_after_key(struct node *, struct node *);
23 struct node *delete_menu(struct node *);
24 struct node *delete_node(struct node *, int);
25 struct node *delete_end(struct node *);
26 struct node *delete_beg(struct node *);
27 struct node *delete_nth(struct node *);
28 struct node *delete_key(struct node *);
29 struct node *misc_menu(struct node *);
30 struct node *misc_op(struct node *, int);
31 void print_reverse_list(struct node *);
~
~
~
“header.h” 31L, 1365C                                                                                                               30,1          All

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>