Page 110 - DCAP201_FUNDAMENTALS_OF_DATA_STRUCTURES
P. 110
Unit 7: Linked Lists
12. A ......................... is a large table of data where most are undefined. Notes
13. In ......................... linked list, last node of the list points back to the first node (or the head)
of the list.
14. In singly linked lists and doubly linked lists the end of lists are indicated with .......... value.
15. A typical ......................... consists of row and column index of the entry, value of the entry,
a pointer to next row and a pointer to next column.
Case Study C Program to Implement Single Linked List
#include <stdio.h>
#include <conio.h>
#include <alloc.h>
void create();
void insert();
void delete();
void display();
struct node
{
int data;
struct node *link;
};
struct node *first=NULL,*last=NULL,*next,*prev,*cur;
void create()
{
cur=(struct node*)malloc(sizeof(struct node));
printf("\nENTER THE DATA: ");
scanf("%d",&cur->data);
cur->link=NULL;
first=cur;
last=cur;
}
void insert()
{
int pos,c=1;
cur=(struct node*)malloc(sizeof(struct node));
printf("\nENTER THE DATA: ");
scanf("%d",&cur->data);
printf("\nENTER THE POSITION: ");
Contd...
LOVELY PROFESSIONAL UNIVERSITY 103