0% found this document useful (0 votes)
39 views23 pages

Data Structures Laboratory-18CSL38

This document describes a railway ticket reservation system project implemented using C programming. The objectives are to computerize the manual reservation process and allow booking from home. A singly linked list and queue data structures are used to store passenger information and the waiting list. Modules for reservation, cancellation, and displaying the lists are implemented. The system aims to reduce burden on travelers and employees. Future enhancements could optimize time complexity and add prioritization and ticket types.

Uploaded by

Shruti Ladage
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views23 pages

Data Structures Laboratory-18CSL38

This document describes a railway ticket reservation system project implemented using C programming. The objectives are to computerize the manual reservation process and allow booking from home. A singly linked list and queue data structures are used to store passenger information and the waiting list. Modules for reservation, cancellation, and displaying the lists are implemented. The system aims to reduce burden on travelers and employees. Future enhancements could optimize time complexity and add prioritization and ticket types.

Uploaded by

Shruti Ladage
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 23

RNS Institute of Technology

(AICTE Approved, VTU Affiliated and NAAC ‘A’ Accredited)


Department of Information Science and Engineering
(Accredited by NBA for the Academic Years 2018-19, 2019-20 and 2020-21)

Data structures Laboratory-18CSL38

BY:
Abhishek – 005
Anurag - 032
Chandan - 051
Anurag Sharma (1RN19IS032)
Chandan Parmar (1RN19IS051)
Abhishek Kumar Singh(1RN19IS005) 1
CONTENTS

 Introduction
 Objective of the project
 Data Structure
 System requirements
 Implementation modules
 Results
 Advantages
 Future Enhancements
 References

02/06/22 Department of ISE,RNSIT 2


Introduction
This system is basically concerned with the
reservation of railway tickets to the passengers.

In this we are discussing that how the reservation is


done with the feature of cancelling and waiting list.

In the project we are going to include entities like


Reservation
Cancellation
Display reserved and waiting list passengers.

02/06/22 Department of ISE,RNSIT 3


OBJECTIVE OF THE PROJECT

All the manual work should be converted into


computerized so that the load of employees should
decrease.
The data should be stored in computer rather than in
register manually.
Booking can be done by sitting at your home only, no
need to visit the booking counter.

02/06/22 Department of ISE,RNSIT 4


Data Structure
Singly Linked List
Linked List is a sequential collection of
nodes.Which is faster than array in terms of
deletion of nodes. It’s memory is dynamically
allocated in runtime. This saves time and
space.
Each node consists of four different data field :
#Name
#Age
#Registration Number
#Link to the next node
02/06/22 Department of ISE,RNSIT 5
Data Structure
Queue
Queue is a data structure in which
insertion and deletion takes place from the
ends. It follows First In First Out
Principle.
Queue data structure is used here to store
the waiting list passengers. If anyone
cancels their ticket then that seat is
allocated to the first passenger in the
queue.
02/06/22 Department of ISE,RNSIT 6
Data Structure
LINEAR QUEUE
A Queue is a linear structure which follows a particular order in which the
operations are performed. The order is First In First Out (FIFO) .In a queue, we
remove the item the least recently added.

02/06/22 Department of ISE,RNSIT 7


SYSTEM REQUIREMENTS

SOFTWARE SPECIFICATION
• Operating System :  OSx
• Frontend  :   C programming
• Backend :   C programming
• IDE     :  Visual Studio Code

02/06/22 Department of ISE,RNSIT 8


Implementation modules
node* deq();
int create();
int reserve(node*);
int cancel(int);
void enq(node*);
void display();

02/06/22 Department of ISE,RNSIT 9


Implementation modules

typedef struct NODE


{
int reg_no;
int age;
char name[20];
struct NODE *next;
} node;

02/06/22 Department of ISE,RNSIT 10


Implementation modules
int create( )
{
node *new;
new=(node *)malloc(sizeof(node));
new->reg_no=1;
printf("Name: ");
scanf("%s", new->name);
printf("Age : ");
scanf("%d", &new->age);
if(new->age>=90 || new->age<=10) {
free(new);
return -1;
}
start=new;
new->next=NULL;
num++;
return 1;

02/06/22 Department of ISE,RNSIT 11


Implementation modules
int reserve(node *start){ scanf("%d", &new_node->age);
int temp; if(new_node->age >=90 || new_node>age<=10) {
if(start==NULL){ return -1;
temp = create(start); }
return temp; new_node->next=NULL;
} if(num<=size){
else { num++;
node *temp, *new_node; new_node->reg_no=num;
temp=start; temp->next=new_node;
while(temp->next!=NULL){ return 1;
temp=temp->next; }
} else{
new_node=(node *)malloc(sizeof(node)); enq(new_node);
printf("Name: "); return 0;
scanf("%s", new_node->name); }
printf("Age : "); }
}

Department of ISE,RNSIT 12
Implementation modules
int cancel(int reg) while(ptr->reg_no!=reg && ptr->next!=NULL)
{ {
preptr=ptr;
node *ptr, *preptr, *new;
ptr=ptr->next;
ptr=start;
}
preptr=NULL;
if(ptr==NULL && ptr->reg_no!=reg)
if(start==NULL) return -1;
return -1; else
if(ptr->next==NULL && ptr- preptr->next=ptr->next;
>reg_no==reg) free(ptr);
{ new=deq();
start=NULL; while(preptr->next!=NULL)
num--; preptr=preptr->next;

free(ptr); preptr->next=new;
num--;
return 1;
return 1;
}
}
else{ }

13
Implementation modules
void enq(node *new_node) node* deq(){
{ node *front1;
if(rear==NULL) front1=front;
{ if(front==NULL)
rear=new_node; return NULL;
rear->next=NULL; else{
front=rear; count-- ;
}
if(front->next!=NULL){
else
front=front->next;
{
front1->next=NULL;
node *temp;
return front1;
temp=new_node;
}
rear->next=temp;
else{
temp->next=NULL;
front=NULL;
rear=temp;
rear=NULL;
}
count++; return front1;
} }}}

14
Implementation modules
void display()
{
node *temp;
temp=start;
while(temp!=NULL)
{
printf("\nRegistration
Number: %d\n", temp->reg_no);
printf("Name : %s\n\n", temp-
>name);
temp=temp->next;
}

15
Results

02/06/22 Department of ISE,RNSIT 16


Results

02/06/22 Department of ISE,RNSIT 17


Results

02/06/22 Department of ISE,RNSIT 18


Results

02/06/22 Department of ISE,RNSIT 19


ADVANTAGES

Reduces the burden of traveler waiting in


the booking counter.
User-friendly.
Convenient.
Time savings.
Helpful during COVID.

02/06/22 Department of ISE,RNSIT 20


Future Enhancements
We can optimise our time complexity
using some different data structure.
We can add features such as prioritising
on the basis of age or railway employees
and gender.
We can add feature of tatkal reservation.
We can provide this solution on online
portal.

02/06/22 Department of ISE,RNSIT 21


References

www.youtube.com
www.tutorialspoint.com
www.greeksforgreek.org

02/06/22 Department of ISE,RNSIT 22


Any Questions?

02/06/22 Department of ISE,RNSIT 23

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy