SlideShare une entreprise Scribd logo
1  sur  3
Télécharger pour lire hors ligne
Assignment 5.1 
Heads On a Roll 
Introduction: 
 
Many a times a complex problem becomes easier to solve if you have the                           
appropriate data structure at hand. More so when the input size involved is very large.                             
Skip List is one such simple data structure which will help you efficiently solve problems                             
where ordering is required or dictionaries are required. 
 
Description: 
 
Given multiple skip lists containing the details of students enrolled in different                       
subjects and a master list (containing all the students’ details), you need to provide                           
answers to different queries (described in later sections), display the number of                       
comparisons taken for the same and produce the trace for the path taken as a graphviz                               
DOT File. 
 
Each student will be represented by a unique ID (key), where each circled part of the ID                                 
represents different entities about the student,  which is described as follows: 
 
 
 
 
Degree Type: 1 ­ B.Tech, 2 ­ M.Tech, 3 ­ PhD 
Year number: 1 to 5 
Department: Between 01 and 09 
Enrollment number: Between 01 and 99  
 
Each of the above mentioned entity will represent a height in the skip list in descending                               
order. Whenever there is a change in the value of an entity, then the student is made                                 
the ‘head’, by having height’s till the entity’s level (from the bottommost level to entity’s                             
height). For example, in the given figure, student with ID “110101” represents the ​first                           
student of B.Tech, the ​first student of 1st year,the ​first student of 1st department ​in                             
the given list​, and hence the height will be 4. Similarly, ID “120101” is a B.Tech                               
student, the ​first student ​of 2nd Year and ​first student ​of 1st department ​in the given                               
list and will have height as 3. Further student with ID “110201” represent a student of                               
B.Tech 1st year and the first student of 2nd department ​in the given list​, and hence                               
the height will be 2. Other students, which do not represent as the first student of any                                 
entity will have height 1. 
 
NOTE: ​It is NOT necessary that the first student of any degree, any branch or any                               
department will have enrollment number as 01. For example, ID “110101” may not have                           
been enrolled in Algorithms subject. In essence if there is change in an entity value from                               
the previous one, then node for the given ID will have pointers till the level of the                                 
particular entity. Please refer the sample input file provided in moodle, where the height                           
is specified. 
 
Master List: 
The master list contains all the students from different degrees and years and                         
departments.  
 
Subject­wise Lists: 
There are two subject­wise lists namely Algorithms list and Information Retrieval                     
(IR) list. These lists will only contain the students enrolled in the respective subject. 
 
 
Task: 
Using the above skip lists, answer the following queries: 
 
Q1. Find all the B.Tech 4th year students who are in the 2nd and 3rd department. 
Q2. Find all the students who are enrolled in Algorithms but not in IR and is a student of                                     
3rd, 4th or 5th Department  
Q3. Find the number of students who have taken both Algorithms and IR. 
Q4.  Find the number of students who have taken either Algorithms or IR. 
Deliverables 
You will submit your C/C++ program along with the makefile, doxy file, DOT file                           
traces (4, one for each query with the ​trace line being red in colour) as a single                                 
rollno_a5­1.tar.gz file in the moodle submission link. You may print the number of                         
comparisons in the screen, after each run. It is mandatory that your code should follow                             
proper indentation and commenting style. There will be deductions in the awarded                       
marks, if you fail to do so. If you are using C++, the use of STL is not permitted. 
 

Contenu connexe

Tendances

C# Value Data Types and Reference Data Types
C# Value Data Types and Reference Data TypesC# Value Data Types and Reference Data Types
C# Value Data Types and Reference Data TypesMicheal Ogundero
 
Data types in c language
Data types in c languageData types in c language
Data types in c languageHarihamShiwani
 
Entity Relationship Diagram part9
Entity Relationship Diagram part9Entity Relationship Diagram part9
Entity Relationship Diagram part9DrMohammed Qassim
 
Erroranalysispresentation 120521215028-phpapp01
Erroranalysispresentation 120521215028-phpapp01Erroranalysispresentation 120521215028-phpapp01
Erroranalysispresentation 120521215028-phpapp01loyola college
 
Primary Key & Foreign Key part10
Primary Key & Foreign Key part10Primary Key & Foreign Key part10
Primary Key & Foreign Key part10DrMohammed Qassim
 
Intelligent Hiring with Resume Parser and Ranking using Natural Language Proc...
Intelligent Hiring with Resume Parser and Ranking using Natural Language Proc...Intelligent Hiring with Resume Parser and Ranking using Natural Language Proc...
Intelligent Hiring with Resume Parser and Ranking using Natural Language Proc...Zainul Sayed
 
Syllabus of BCA Second Year JAMMU University
Syllabus of BCA Second Year JAMMU UniversitySyllabus of BCA Second Year JAMMU University
Syllabus of BCA Second Year JAMMU UniversityRavi Shairaywal
 
Engineering college PPT
Engineering college PPTEngineering college PPT
Engineering college PPTTheTrojan
 
Frequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersFrequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersnishajj
 
AP Computer Science Test Prep Part 1 - Introduction to java Programming
AP Computer Science Test Prep Part 1 - Introduction to java ProgrammingAP Computer Science Test Prep Part 1 - Introduction to java Programming
AP Computer Science Test Prep Part 1 - Introduction to java ProgrammingNR Computer Learning Center
 

Tendances (19)

C# Value Data Types and Reference Data Types
C# Value Data Types and Reference Data TypesC# Value Data Types and Reference Data Types
C# Value Data Types and Reference Data Types
 
Audit
AuditAudit
Audit
 
Data types in c language
Data types in c languageData types in c language
Data types in c language
 
Linux IV - PERL
Linux IV - PERLLinux IV - PERL
Linux IV - PERL
 
Entity Relationship Diagram part9
Entity Relationship Diagram part9Entity Relationship Diagram part9
Entity Relationship Diagram part9
 
Resume
ResumeResume
Resume
 
Lec9
Lec9Lec9
Lec9
 
Erroranalysispresentation 120521215028-phpapp01
Erroranalysispresentation 120521215028-phpapp01Erroranalysispresentation 120521215028-phpapp01
Erroranalysispresentation 120521215028-phpapp01
 
Primary Key & Foreign Key part10
Primary Key & Foreign Key part10Primary Key & Foreign Key part10
Primary Key & Foreign Key part10
 
Intelligent Hiring with Resume Parser and Ranking using Natural Language Proc...
Intelligent Hiring with Resume Parser and Ranking using Natural Language Proc...Intelligent Hiring with Resume Parser and Ranking using Natural Language Proc...
Intelligent Hiring with Resume Parser and Ranking using Natural Language Proc...
 
Resume parser
Resume parserResume parser
Resume parser
 
Syllabus of BCA Second Year JAMMU University
Syllabus of BCA Second Year JAMMU UniversitySyllabus of BCA Second Year JAMMU University
Syllabus of BCA Second Year JAMMU University
 
Engineering college PPT
Engineering college PPTEngineering college PPT
Engineering college PPT
 
Frequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answersFrequently asked tcs technical interview questions and answers
Frequently asked tcs technical interview questions and answers
 
Data type
Data typeData type
Data type
 
Hema wt (1)
Hema wt (1)Hema wt (1)
Hema wt (1)
 
AP Computer Science Test Prep Part 1 - Introduction to java Programming
AP Computer Science Test Prep Part 1 - Introduction to java ProgrammingAP Computer Science Test Prep Part 1 - Introduction to java Programming
AP Computer Science Test Prep Part 1 - Introduction to java Programming
 
Word processing
Word processingWord processing
Word processing
 
Moran Navon CV-
Moran Navon CV-Moran Navon CV-
Moran Navon CV-
 

Plus de Amrith Krishna

Unsupervised program synthesis
Unsupervised program synthesisUnsupervised program synthesis
Unsupervised program synthesisAmrith Krishna
 
Analyzing Stack Overflow - Problem
Analyzing Stack Overflow - ProblemAnalyzing Stack Overflow - Problem
Analyzing Stack Overflow - ProblemAmrith Krishna
 
Asterix and the Maagic Potion - Suffix tree problem
Asterix and the Maagic Potion - Suffix tree problemAsterix and the Maagic Potion - Suffix tree problem
Asterix and the Maagic Potion - Suffix tree problemAmrith Krishna
 
Roller Coaster Problem - OS
Roller Coaster Problem  - OSRoller Coaster Problem  - OS
Roller Coaster Problem - OSAmrith Krishna
 
File Watcher - Lab Assignment
File Watcher - Lab AssignmentFile Watcher - Lab Assignment
File Watcher - Lab AssignmentAmrith Krishna
 
R - Eigen vector centrality with product reviews
R - Eigen vector centrality with product reviewsR - Eigen vector centrality with product reviews
R - Eigen vector centrality with product reviewsAmrith Krishna
 
Skipl List implementation - Part 1
Skipl List implementation - Part 1Skipl List implementation - Part 1
Skipl List implementation - Part 1Amrith Krishna
 
Maach-Dal-Bhaat Problem
Maach-Dal-Bhaat ProblemMaach-Dal-Bhaat Problem
Maach-Dal-Bhaat ProblemAmrith Krishna
 
Named Entity recognition in Sanskrit
Named Entity recognition in SanskritNamed Entity recognition in Sanskrit
Named Entity recognition in SanskritAmrith Krishna
 
Astra word Segmentation
Astra word SegmentationAstra word Segmentation
Astra word SegmentationAmrith Krishna
 
Segmentation in Sanskrit texts
Segmentation in Sanskrit textsSegmentation in Sanskrit texts
Segmentation in Sanskrit textsAmrith Krishna
 

Plus de Amrith Krishna (16)

Unsupervised program synthesis
Unsupervised program synthesisUnsupervised program synthesis
Unsupervised program synthesis
 
Analyzing Stack Overflow - Problem
Analyzing Stack Overflow - ProblemAnalyzing Stack Overflow - Problem
Analyzing Stack Overflow - Problem
 
Asterix and the Maagic Potion - Suffix tree problem
Asterix and the Maagic Potion - Suffix tree problemAsterix and the Maagic Potion - Suffix tree problem
Asterix and the Maagic Potion - Suffix tree problem
 
Roller Coaster Problem - OS
Roller Coaster Problem  - OSRoller Coaster Problem  - OS
Roller Coaster Problem - OS
 
File Watcher - Lab Assignment
File Watcher - Lab AssignmentFile Watcher - Lab Assignment
File Watcher - Lab Assignment
 
R - Eigen vector centrality with product reviews
R - Eigen vector centrality with product reviewsR - Eigen vector centrality with product reviews
R - Eigen vector centrality with product reviews
 
Skipl List implementation - Part 1
Skipl List implementation - Part 1Skipl List implementation - Part 1
Skipl List implementation - Part 1
 
Maach-Dal-Bhaat Problem
Maach-Dal-Bhaat ProblemMaach-Dal-Bhaat Problem
Maach-Dal-Bhaat Problem
 
QGene Quiz 2016
QGene Quiz 2016QGene Quiz 2016
QGene Quiz 2016
 
Named Entity recognition in Sanskrit
Named Entity recognition in SanskritNamed Entity recognition in Sanskrit
Named Entity recognition in Sanskrit
 
Astra word Segmentation
Astra word SegmentationAstra word Segmentation
Astra word Segmentation
 
Segmentation in Sanskrit texts
Segmentation in Sanskrit textsSegmentation in Sanskrit texts
Segmentation in Sanskrit texts
 
ShutApp
ShutAppShutApp
ShutApp
 
Ferosa - Insights
Ferosa - InsightsFerosa - Insights
Ferosa - Insights
 
Taddhita Generation
Taddhita GenerationTaddhita Generation
Taddhita Generation
 
Windows Architecture
Windows ArchitectureWindows Architecture
Windows Architecture
 

Dernier

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Dernier (20)

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 

Find Students Across Multiple Skip Lists in C/C

  • 1. Assignment 5.1  Heads On a Roll  Introduction:    Many a times a complex problem becomes easier to solve if you have the                            appropriate data structure at hand. More so when the input size involved is very large.                              Skip List is one such simple data structure which will help you efficiently solve problems                              where ordering is required or dictionaries are required.    Description:    Given multiple skip lists containing the details of students enrolled in different                        subjects and a master list (containing all the students’ details), you need to provide                            answers to different queries (described in later sections), display the number of                        comparisons taken for the same and produce the trace for the path taken as a graphviz                                DOT File.    Each student will be represented by a unique ID (key), where each circled part of the ID                                  represents different entities about the student,  which is described as follows:          Degree Type: 1 ­ B.Tech, 2 ­ M.Tech, 3 ­ PhD  Year number: 1 to 5  Department: Between 01 and 09  Enrollment number: Between 01 and 99     Each of the above mentioned entity will represent a height in the skip list in descending                                order. Whenever there is a change in the value of an entity, then the student is made                                 
  • 2. the ‘head’, by having height’s till the entity’s level (from the bottommost level to entity’s                              height). For example, in the given figure, student with ID “110101” represents the ​first                            student of B.Tech, the ​first student of 1st year,the ​first student of 1st department ​in                              the given list​, and hence the height will be 4. Similarly, ID “120101” is a B.Tech                                student, the ​first student ​of 2nd Year and ​first student ​of 1st department ​in the given                                list and will have height as 3. Further student with ID “110201” represent a student of                                B.Tech 1st year and the first student of 2nd department ​in the given list​, and hence                                the height will be 2. Other students, which do not represent as the first student of any                                  entity will have height 1.    NOTE: ​It is NOT necessary that the first student of any degree, any branch or any                                department will have enrollment number as 01. For example, ID “110101” may not have                            been enrolled in Algorithms subject. In essence if there is change in an entity value from                                the previous one, then node for the given ID will have pointers till the level of the                                  particular entity. Please refer the sample input file provided in moodle, where the height                            is specified.    Master List:  The master list contains all the students from different degrees and years and                          departments.     Subject­wise Lists:  There are two subject­wise lists namely Algorithms list and Information Retrieval                      (IR) list. These lists will only contain the students enrolled in the respective subject.      Task:  Using the above skip lists, answer the following queries:    Q1. Find all the B.Tech 4th year students who are in the 2nd and 3rd department.  Q2. Find all the students who are enrolled in Algorithms but not in IR and is a student of                                      3rd, 4th or 5th Department   Q3. Find the number of students who have taken both Algorithms and IR.  Q4.  Find the number of students who have taken either Algorithms or IR. 
  • 3. Deliverables  You will submit your C/C++ program along with the makefile, doxy file, DOT file                            traces (4, one for each query with the ​trace line being red in colour) as a single                                  rollno_a5­1.tar.gz file in the moodle submission link. You may print the number of                          comparisons in the screen, after each run. It is mandatory that your code should follow                              proper indentation and commenting style. There will be deductions in the awarded                        marks, if you fail to do so. If you are using C++, the use of STL is not permitted.