Submit Search
Upload
P5
•
Download as TXT, PDF
•
0 likes
•
11 views
Y
YashaswiniYashu17
Follow
this is k-way merge algorithm
Read less
Read more
Software
Report
Share
Report
Share
1 of 4
Download now
Recommended
ONLINE STUDENT MANAGEMENT SYSTEM
ONLINE STUDENT MANAGEMENT SYSTEM
Rohit malav
Scala Days 2011 - Rogue: A Type-Safe DSL for MongoDB
Scala Days 2011 - Rogue: A Type-Safe DSL for MongoDB
jorgeortiz85
Exmaples of file handling
Exmaples of file handling
sparkishpearl
Security Bootcamp 2013 lap trinh web an toan
Security Bootcamp 2013 lap trinh web an toan
Security Bootcamp
Security Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp
Tips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET Application
Joni
Scala 生态圈 (scala ecosystem)
Scala 生态圈 (scala ecosystem)
max peng
Ecma script 5
Ecma script 5
Alexander Tarasyuk
Recommended
ONLINE STUDENT MANAGEMENT SYSTEM
ONLINE STUDENT MANAGEMENT SYSTEM
Rohit malav
Scala Days 2011 - Rogue: A Type-Safe DSL for MongoDB
Scala Days 2011 - Rogue: A Type-Safe DSL for MongoDB
jorgeortiz85
Exmaples of file handling
Exmaples of file handling
sparkishpearl
Security Bootcamp 2013 lap trinh web an toan
Security Bootcamp 2013 lap trinh web an toan
Security Bootcamp
Security Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp 2013 - Lap trinh web an toan
Security Bootcamp
Tips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET Application
Joni
Scala 生态圈 (scala ecosystem)
Scala 生态圈 (scala ecosystem)
max peng
Ecma script 5
Ecma script 5
Alexander Tarasyuk
Introduction to ES6 with Tommy Cresine
Introduction to ES6 with Tommy Cresine
Movel
How to write rust instead of c and get away with it
How to write rust instead of c and get away with it
Flavien Raynaud
Un dsl pour ma base de données
Un dsl pour ma base de données
Romain Lecomte
Simple uses of ADRCI
Simple uses of ADRCI
Douglas Hawthorne
PHP 7 – What changed internally?
PHP 7 – What changed internally?
Nikita Popov
PHP 7 – What changed internally? (PHP Barcelona 2015)
PHP 7 – What changed internally? (PHP Barcelona 2015)
Nikita Popov
JavaScript Performance 20160723
JavaScript Performance 20160723
kamiyam .
PHP 7 – What changed internally? (Forum PHP 2015)
PHP 7 – What changed internally? (Forum PHP 2015)
Nikita Popov
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Mail.ru Group
Sample file processing
Sample file processing
Issay Meii
Objective-C Survives
Objective-C Survives
S Akai
File Handling Program
File Handling Program
တမန္ေတာ္ က်ဴးပါက်ဲ
RubyistのためのObjective-C入門
RubyistのためのObjective-C入門
S Akai
Why I love Python!
Why I love Python!
Johannes Ridderstedt
PHP object calisthenics
PHP object calisthenics
Giorgio Cefaro
CLinkedList
CLinkedList
Thomas Knudstrup
ios,objective tutorial
ios,objective tutorial
Bhavik Patel
Bits, bytes and characters
Bits, bytes and characters
Shaikhul Islam Chowdhury
JavaOne 2016 - JVM assisted sensitive data
JavaOne 2016 - JVM assisted sensitive data
Charlie Gracie
SPL - The Undiscovered Library - PHPBarcelona 2015
SPL - The Undiscovered Library - PHPBarcelona 2015
Mark Baker
Student Data Base Using C/C++ Final Project
Student Data Base Using C/C++ Final Project
Haqnawaz Ch
C-Program Custom Library, Header File, and Implementation FilesI .pdf
C-Program Custom Library, Header File, and Implementation FilesI .pdf
herminaherman
More Related Content
What's hot
Introduction to ES6 with Tommy Cresine
Introduction to ES6 with Tommy Cresine
Movel
How to write rust instead of c and get away with it
How to write rust instead of c and get away with it
Flavien Raynaud
Un dsl pour ma base de données
Un dsl pour ma base de données
Romain Lecomte
Simple uses of ADRCI
Simple uses of ADRCI
Douglas Hawthorne
PHP 7 – What changed internally?
PHP 7 – What changed internally?
Nikita Popov
PHP 7 – What changed internally? (PHP Barcelona 2015)
PHP 7 – What changed internally? (PHP Barcelona 2015)
Nikita Popov
JavaScript Performance 20160723
JavaScript Performance 20160723
kamiyam .
PHP 7 – What changed internally? (Forum PHP 2015)
PHP 7 – What changed internally? (Forum PHP 2015)
Nikita Popov
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Mail.ru Group
Sample file processing
Sample file processing
Issay Meii
Objective-C Survives
Objective-C Survives
S Akai
File Handling Program
File Handling Program
တမန္ေတာ္ က်ဴးပါက်ဲ
RubyistのためのObjective-C入門
RubyistのためのObjective-C入門
S Akai
Why I love Python!
Why I love Python!
Johannes Ridderstedt
PHP object calisthenics
PHP object calisthenics
Giorgio Cefaro
CLinkedList
CLinkedList
Thomas Knudstrup
ios,objective tutorial
ios,objective tutorial
Bhavik Patel
Bits, bytes and characters
Bits, bytes and characters
Shaikhul Islam Chowdhury
JavaOne 2016 - JVM assisted sensitive data
JavaOne 2016 - JVM assisted sensitive data
Charlie Gracie
SPL - The Undiscovered Library - PHPBarcelona 2015
SPL - The Undiscovered Library - PHPBarcelona 2015
Mark Baker
What's hot
(20)
Introduction to ES6 with Tommy Cresine
Introduction to ES6 with Tommy Cresine
How to write rust instead of c and get away with it
How to write rust instead of c and get away with it
Un dsl pour ma base de données
Un dsl pour ma base de données
Simple uses of ADRCI
Simple uses of ADRCI
PHP 7 – What changed internally?
PHP 7 – What changed internally?
PHP 7 – What changed internally? (PHP Barcelona 2015)
PHP 7 – What changed internally? (PHP Barcelona 2015)
JavaScript Performance 20160723
JavaScript Performance 20160723
PHP 7 – What changed internally? (Forum PHP 2015)
PHP 7 – What changed internally? (Forum PHP 2015)
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Sample file processing
Sample file processing
Objective-C Survives
Objective-C Survives
File Handling Program
File Handling Program
RubyistのためのObjective-C入門
RubyistのためのObjective-C入門
Why I love Python!
Why I love Python!
PHP object calisthenics
PHP object calisthenics
CLinkedList
CLinkedList
ios,objective tutorial
ios,objective tutorial
Bits, bytes and characters
Bits, bytes and characters
JavaOne 2016 - JVM assisted sensitive data
JavaOne 2016 - JVM assisted sensitive data
SPL - The Undiscovered Library - PHPBarcelona 2015
SPL - The Undiscovered Library - PHPBarcelona 2015
Similar to P5
Student Data Base Using C/C++ Final Project
Student Data Base Using C/C++ Final Project
Haqnawaz Ch
C-Program Custom Library, Header File, and Implementation FilesI .pdf
C-Program Custom Library, Header File, and Implementation FilesI .pdf
herminaherman
C program
C program
Komal Singh
Programs of C++
Programs of C++
The University of Faisalabad; Madina University
c++ program for Railway reservation
c++ program for Railway reservation
Swarup Kumar Boro
Railway reservation
Railway reservation
Swarup Boro
Institute management
Institute management
varun arora
Singly linked list.pptx
Singly linked list.pptx
Santhiya S
20DCE096_prac8.pdf
20DCE096_prac8.pdf
ShivangPithadiya1
#include iostream #include fstream #include map #include.pdf
#include iostream #include fstream #include map #include.pdf
inbox5
Array of objects.pptx
Array of objects.pptx
RAGAVIC2
Data structure
Data structure
Markustec
Sbaw091006
Sbaw091006
Atsushi Tadokoro
PPS Notes Unit 5.pdf
PPS Notes Unit 5.pdf
Sreedhar Chowdam
streams and files
streams and files
Mariam Butt
Arp
Arp
Ebsil Sherly
A comparison between C# and Java
A comparison between C# and Java
Ali MasudianPour
Usp
Usp
preethamnaik92
STL
STL
Naoya Nakazawa
TypeScript Introduction
TypeScript Introduction
Hans Höchtl
Similar to P5
(20)
Student Data Base Using C/C++ Final Project
Student Data Base Using C/C++ Final Project
C-Program Custom Library, Header File, and Implementation FilesI .pdf
C-Program Custom Library, Header File, and Implementation FilesI .pdf
C program
C program
Programs of C++
Programs of C++
c++ program for Railway reservation
c++ program for Railway reservation
Railway reservation
Railway reservation
Institute management
Institute management
Singly linked list.pptx
Singly linked list.pptx
20DCE096_prac8.pdf
20DCE096_prac8.pdf
#include iostream #include fstream #include map #include.pdf
#include iostream #include fstream #include map #include.pdf
Array of objects.pptx
Array of objects.pptx
Data structure
Data structure
Sbaw091006
Sbaw091006
PPS Notes Unit 5.pdf
PPS Notes Unit 5.pdf
streams and files
streams and files
Arp
Arp
A comparison between C# and Java
A comparison between C# and Java
Usp
Usp
STL
STL
TypeScript Introduction
TypeScript Introduction
Recently uploaded
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
Philip Schwarz
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
VICTOR MAESTRE RAMIREZ
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
Neo4j
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
OPEN KNOWLEDGE GmbH
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
Dinusha Kumarasiri
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
stazi3110
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
soniya singh
MYjobs Presentation Django-based project
MYjobs Presentation Django-based project
AnoyGreter
Professional Resume Template for Software Developers
Professional Resume Template for Software Developers
Vinodh Ram
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
kotipi9215
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
BradBedford3
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
Sujith Sukumaran
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio, Inc.
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
VICTOR MAESTRE RAMIREZ
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
AxelRicardoTrocheRiq
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
OnePlan Solutions
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
OnePlan Solutions
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
Łukasz Chruściel
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Ahmed Mohamed
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
kzayra69
Recently uploaded
(20)
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
MYjobs Presentation Django-based project
MYjobs Presentation Django-based project
Professional Resume Template for Software Developers
Professional Resume Template for Software Developers
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
P5
1.
#include<iostream> #include<stdio.h> #include<string.h> #include<fstream> #include<stdlib.h> #include<iomanip> //record specification using namespace
std; fstream data,indx; char pri[125][15]; // to hold primary keys int ind[125],count=0; void sort1(); class student { public : char Regno[10], Name[25], Address[50], Sem[5], Branch[10], College[15]; public: void Insert(); void Delete(); void Search(char *a); /* To display individual record */ void Display();/* to display all records in file-- yet to implement*/ // void Loadindx(); void Writeindx(); }s; void student::Insert() { char Buffer[100],offset[10]; int pos, high = count; data.open("stu.txt",ios::app); data.seekg(0,ios::end); pos=data.tellg(); // gets the address of that posn cout<<"ENTER RECORD DETAILSn"; cout<<"RegNo : "; cin>>s.Regno; for(int low=0;low<=high;) { int mid = (low+high)/2; int k = atoi(pri[mid]), m = atoi(s.Regno); if(k == m) { cout<<setw(44)<<"DUPLICATE RECORD !!!"; return; } else if(m < k) high = mid-1; else if(m > k) low = mid + 1; } // to search for duplicate usn -- can avoid cout<<"Name : "; cin>>s.Name; cout<<"Address : "; cin>>s.Address; cout<<"Sem : "; cin>>s.Sem; cout<<"Branch : "; cin>>s.Branch; cout<<"College : "; cin>>s.College; sprintf(Buffer,"|%s|%s|%s|%s|%s|%s| #",s.Regno,s.Name,s.Address,s.Sem,s.Branch,s.College); data<<Buffer;
2.
strcpy(pri[count],s.Regno); ind[count]=pos; count++; cout<<count; data.close(); s.Writeindx(); } void student::Writeindx() { char buffer[100]; int
i; indx.open("inx.txt", ios::out); sort1(); for(i=0;i<count;i++) { //itoa(ind[i],buffer,10); sprintf(buffer, "%d", ind[i]); indx<<"|"<<pri[i]<<"|"<<buffer<<"|"<<"#"; } indx.close(); } void sort1() { char temp[20]; int tempind,k,i,j,l; for(i=0;i<count;i++) { for(j=i+1;j<count;j++) { k = atoi(pri[i]); l = atoi(pri[j]); if(k > l) { strcpy(temp,pri[i]); strcpy(pri[i],pri[j]); strcpy(pri[j],temp); tempind=ind[j]; ind[j]=ind[i]; ind[i]=tempind; } } } } void student::Search(char *reg) { int high = count,flag1=0; char Buffer[100]; data.open("stu.txt",ios::in); for(int low=0;low<=high;) { int mid = (low+high)/2; int k = atoi(pri[mid]), m = atoi(reg); if(k == m) // or else use strcmp()==0 { flag1 = 1; data.seekg(ind[mid],ios::beg); data.getline(Buffer,100,'#'); sscanf(Buffer,"|%[^|]|%[^|]|%[^|]|%[^|]|%[^|]|% [^|]#",s.Regno,s.Name,s.Address,s.Sem,s.Branch,s.College); cout<<endl<<"RECORD DETAILS"<<endl; cout<<endl<<"URN : "<<s.Regno; cout<<endl<<"NAME : "<<s.Name; cout<<endl<<"ADDRESS : "<<s.Address; cout<<endl<<"SEMESTER : "<<s.Sem;
3.
cout<<endl<<"BRANCH : "<<s.Branch; cout<<endl<<"COLLEGE
: "<<s.College<<"n"; data.close(); return; // or use break stmt here } else if(m < k) high = mid-1; else if(m > k) low = mid + 1; } if(flag1==0) cout<<endl<<"RECORD DOES NOT EXISTSn"; data.close(); } void student::Delete() { char reg[20],Buffer[100],usn[15]; int high = count,flag=0; cout<<endl<<"ENTER USN: "; cin>>reg; data.open("stu.txt",ios::in | ios::out); for(int low=0;low<=high;) { int mid = (low+high)/2; int k = atoi(pri[mid]), m = atoi(reg); if(k == m) { flag=1; data.seekg(ind[mid],ios::beg); data.getline(Buffer,100,'#'); Buffer[0]='*'; pri[mid][0]='*'; data.seekg(ind[mid],ios::beg); data<<Buffer; cout<<endl<<"RECORD DELETED"; data.close(); s.Writeindx(); return; } else if(m < k) high = mid-1; else if(m > k) low = mid + 1; } if(flag==0) { cout<<endl<<"RECORD NOT FOUND !!!"; } data.close(); } void student :: Display() { char Buffer[100]; data.open("stu.txt",ios::in); char b[100]; while(!data.eof()) { data.getline(Buffer,100,'#'); if(data.eof())
4.
break; if(Buffer[0]!='*') { sscanf(Buffer,"|%[^|]|%[^|]|%[^|]|%[^|]|%[^|]|% [^|]#",s.Regno,s.Name,s.Address,s.Sem,s.Branch,s.College); cout<<s.Regno<<" "<<s.Name<<" "<<s.Address<<"
"<<s.Sem<<" "<<s.Branch<<" "<<s.College<<endl; } else continue; } data.close(); } int main() { fstream f1,f2; int choice; char usn[20]; for(;;) { cout<<"n1.Add record n2.search record n 3.deleterecordn4.display recordn"; cin>>choice; switch(choice) { case 1:s.Insert(); break; case 2:cout<<endl<<"ENTER UsN: "; cin>>usn; s.Search(usn); break; case 3:s.Delete(); break; case 4: s.Display(); break; default: exit(0); } } }
Download now