SlideShare une entreprise Scribd logo
1  sur  4
Ministry of Higher Education Course: File organization- INF 221
Higher Technological Institute
Computer Science Department
Second Year
Sheet 5: Sequential and Direct File Organization Theoretical
1. Define each of the following with example:
• Record: Unit of information which contains data about individual entities.
• Field: is a decompose atomic unit of the record.
2. Compare between sequential search and direct access?
Sequential Search: is a method (algorithm) of searching a file by reading the file from the
beginning and continuing until you have read in every thing that you need.
 Look at records sequentially until matching record is found. Time is in O(n) for n records.
 Appropriate for pattern matching, file with few records.
Direct Access: it is based on disk model. It allows random access. User can jump to any record
and access that record. Following operations are supported.
 Being able to seek directly to the beginning of the record. Time is in O(1) for n records.
 Possible when we know the Relative Record Number (RRN): First record has RRN 0, the
next has RRN 1, etc.
3. What is the difference between binary and interpolation search?
The binary search method requires:
•records are stored in a sorted list.
•the list is randomly accessible
Interpolation search
This search algorithm works on the probing position of the required value. For this algorithm to
work properly, the data collection should be in a sorted form and equally distributed.
4. Describe in details self organizing sequential search?
Self-organizing lists modify the order in which records are stored based on the actual or
expected access pattern. The goal is to achieve an ordering that keeps the most frequently
sought records closest to the front of the list.
Common heuristics:
•frequency count: order by the actual historical frequency of access
•move-to-front: when a record is accessed, move it to the front of the list
•transpose: when a record is accessed, swap it with the preceding record in the list
Problems
5. Using binary search for the following sequence to search 18:
Programs
6. Write a program for problem 5 by using C or C++.
Research
7. Make problem 6 by any IDE for C/C++.
with all my best wishes
| P a g e 1
sheet 5.docx

Contenu connexe

Similaire à sheet 5.docx

Callahan princetonenug2011
Callahan princetonenug2011Callahan princetonenug2011
Callahan princetonenug2011
ENUG
 
Boolean Retrieval
Boolean RetrievalBoolean Retrieval
Boolean Retrieval
mghgk
 
Data Structure - Complete Basic Overview.ppt
Data Structure - Complete Basic Overview.pptData Structure - Complete Basic Overview.ppt
Data Structure - Complete Basic Overview.ppt
ak8820
 
score based ranking of documents
score based ranking of documentsscore based ranking of documents
score based ranking of documents
Kriti Khanna
 
Techniques of information retrieval
Techniques of information retrieval Techniques of information retrieval
Techniques of information retrieval
Tariq Hassan
 

Similaire à sheet 5.docx (20)

Chapter 3 Indexing Structure.pdf
Chapter 3 Indexing Structure.pdfChapter 3 Indexing Structure.pdf
Chapter 3 Indexing Structure.pdf
 
files,indexing,hashing,linear and non linear hashing
files,indexing,hashing,linear and non linear hashingfiles,indexing,hashing,linear and non linear hashing
files,indexing,hashing,linear and non linear hashing
 
Callahan princetonenug2011
Callahan princetonenug2011Callahan princetonenug2011
Callahan princetonenug2011
 
itft-File design
itft-File designitft-File design
itft-File design
 
Boolean Retrieval
Boolean RetrievalBoolean Retrieval
Boolean Retrieval
 
cs702 ppt.ppt
cs702 ppt.pptcs702 ppt.ppt
cs702 ppt.ppt
 
Data Structure - Complete Basic Overview.ppt
Data Structure - Complete Basic Overview.pptData Structure - Complete Basic Overview.ppt
Data Structure - Complete Basic Overview.ppt
 
Chapter 1: Introduction to Information Storage and Retrieval
Chapter 1: Introduction to Information Storage and RetrievalChapter 1: Introduction to Information Storage and Retrieval
Chapter 1: Introduction to Information Storage and Retrieval
 
File organisation
File organisationFile organisation
File organisation
 
SearchAlgorithm.pdf
SearchAlgorithm.pdfSearchAlgorithm.pdf
SearchAlgorithm.pdf
 
Database Management System-Module-IV(part-1).pptx
Database Management System-Module-IV(part-1).pptxDatabase Management System-Module-IV(part-1).pptx
Database Management System-Module-IV(part-1).pptx
 
Application portfolio development.advadisadvan.pptx
Application portfolio development.advadisadvan.pptxApplication portfolio development.advadisadvan.pptx
Application portfolio development.advadisadvan.pptx
 
Db lec 08_new
Db lec 08_newDb lec 08_new
Db lec 08_new
 
score based ranking of documents
score based ranking of documentsscore based ranking of documents
score based ranking of documents
 
Techniques of information retrieval
Techniques of information retrieval Techniques of information retrieval
Techniques of information retrieval
 
Unit ivos - file systems
Unit ivos - file systemsUnit ivos - file systems
Unit ivos - file systems
 
File organisation
File organisationFile organisation
File organisation
 
Data structure and algorithms
Data structure and algorithmsData structure and algorithms
Data structure and algorithms
 
Entrez databases
Entrez databasesEntrez databases
Entrez databases
 
Importing life science at a into Neo4j
Importing life science at a into Neo4jImporting life science at a into Neo4j
Importing life science at a into Neo4j
 

Plus de MohamedAyman183185 (12)

Kareem Atif Mohamed 1851711195.pptx
Kareem Atif Mohamed 1851711195.pptxKareem Atif Mohamed 1851711195.pptx
Kareem Atif Mohamed 1851711195.pptx
 
sheet 3 answers.docx
sheet 3 answers.docxsheet 3 answers.docx
sheet 3 answers.docx
 
sheet 3-4.pdf
sheet 3-4.pdfsheet 3-4.pdf
sheet 3-4.pdf
 
sheet 1.docx
sheet 1.docxsheet 1.docx
sheet 1.docx
 
file organization sheet 2 .pdf
file organization sheet 2 .pdffile organization sheet 2 .pdf
file organization sheet 2 .pdf
 
Task mo7drt File Organization.docx
Task mo7drt File Organization.docxTask mo7drt File Organization.docx
Task mo7drt File Organization.docx
 
sheet 4.docx
sheet 4.docxsheet 4.docx
sheet 4.docx
 
file organization sheet 2 .docx
file organization sheet 2 .docxfile organization sheet 2 .docx
file organization sheet 2 .docx
 
Mohamed Ayman Task3 RAID.docx
Mohamed Ayman Task3 RAID.docxMohamed Ayman Task3 RAID.docx
Mohamed Ayman Task3 RAID.docx
 
Mohamed Ayman EL-Sayed ID 42020424 G4.pdf
Mohamed Ayman EL-Sayed   ID 42020424   G4.pdfMohamed Ayman EL-Sayed   ID 42020424   G4.pdf
Mohamed Ayman EL-Sayed ID 42020424 G4.pdf
 
Medical Diagnosis Expert System Report.docx
Medical Diagnosis Expert System Report.docxMedical Diagnosis Expert System Report.docx
Medical Diagnosis Expert System Report.docx
 
Report of Introduction and methods Explination.docx
Report of Introduction and methods Explination.docxReport of Introduction and methods Explination.docx
Report of Introduction and methods Explination.docx
 

Dernier

Corporate Presentation Probe Canaccord Conference 2024.pdf
Corporate Presentation Probe Canaccord Conference 2024.pdfCorporate Presentation Probe Canaccord Conference 2024.pdf
Corporate Presentation Probe Canaccord Conference 2024.pdf
Probe Gold
 
Terna - 1Q 2024 Consolidated Results Presentation
Terna - 1Q 2024 Consolidated Results PresentationTerna - 1Q 2024 Consolidated Results Presentation
Terna - 1Q 2024 Consolidated Results Presentation
Terna SpA
 

Dernier (20)

Corporate Presentation Probe Canaccord Conference 2024.pdf
Corporate Presentation Probe Canaccord Conference 2024.pdfCorporate Presentation Probe Canaccord Conference 2024.pdf
Corporate Presentation Probe Canaccord Conference 2024.pdf
 
Teck Supplemental Information, May 2, 2024
Teck Supplemental Information, May 2, 2024Teck Supplemental Information, May 2, 2024
Teck Supplemental Information, May 2, 2024
 
ITAU EQUITY_STRATEGY_WARM_UP_20240505 DHG.pdf
ITAU EQUITY_STRATEGY_WARM_UP_20240505 DHG.pdfITAU EQUITY_STRATEGY_WARM_UP_20240505 DHG.pdf
ITAU EQUITY_STRATEGY_WARM_UP_20240505 DHG.pdf
 
Camil Institutional Presentation_Mai24.pdf
Camil Institutional Presentation_Mai24.pdfCamil Institutional Presentation_Mai24.pdf
Camil Institutional Presentation_Mai24.pdf
 
countries with the highest gold reserves in 2024
countries with the highest gold reserves in 2024countries with the highest gold reserves in 2024
countries with the highest gold reserves in 2024
 
Teekay Corporation Q1-24 Earnings Results
Teekay Corporation Q1-24 Earnings ResultsTeekay Corporation Q1-24 Earnings Results
Teekay Corporation Q1-24 Earnings Results
 
Financial Results for the Fiscal Year Ended March 2024
Financial Results for the Fiscal Year Ended March 2024Financial Results for the Fiscal Year Ended March 2024
Financial Results for the Fiscal Year Ended March 2024
 
Diligence Checklist for Early Stage Startups
Diligence Checklist for Early Stage StartupsDiligence Checklist for Early Stage Startups
Diligence Checklist for Early Stage Startups
 
Western Copper and Gold - May 2024 Presentation
Western Copper and Gold - May 2024 PresentationWestern Copper and Gold - May 2024 Presentation
Western Copper and Gold - May 2024 Presentation
 
Osisko Gold Royalties Ltd - Corporate Presentation, May 2024
Osisko Gold Royalties Ltd - Corporate Presentation, May 2024Osisko Gold Royalties Ltd - Corporate Presentation, May 2024
Osisko Gold Royalties Ltd - Corporate Presentation, May 2024
 
Terna - 1Q 2024 Consolidated Results Presentation
Terna - 1Q 2024 Consolidated Results PresentationTerna - 1Q 2024 Consolidated Results Presentation
Terna - 1Q 2024 Consolidated Results Presentation
 
Camil Institutional Presentation_Mai24.pdf
Camil Institutional Presentation_Mai24.pdfCamil Institutional Presentation_Mai24.pdf
Camil Institutional Presentation_Mai24.pdf
 
SME IPO Opportunity and Trends of May 2024
SME IPO Opportunity and Trends of May 2024SME IPO Opportunity and Trends of May 2024
SME IPO Opportunity and Trends of May 2024
 
The Leonardo 1Q 2024 Results Presentation
The Leonardo 1Q 2024 Results PresentationThe Leonardo 1Q 2024 Results Presentation
The Leonardo 1Q 2024 Results Presentation
 
Osisko Development - Investor Presentation - May 2024
Osisko Development - Investor Presentation - May 2024Osisko Development - Investor Presentation - May 2024
Osisko Development - Investor Presentation - May 2024
 
Teekay Tankers Q1-24 Earnings Presentation
Teekay Tankers Q1-24 Earnings PresentationTeekay Tankers Q1-24 Earnings Presentation
Teekay Tankers Q1-24 Earnings Presentation
 
Osisko Gold Royalties Ltd - Q1 2024 Results
Osisko Gold Royalties Ltd - Q1 2024 ResultsOsisko Gold Royalties Ltd - Q1 2024 Results
Osisko Gold Royalties Ltd - Q1 2024 Results
 
AMG Quarterly Investor Presentation May 2024
AMG Quarterly Investor Presentation May 2024AMG Quarterly Investor Presentation May 2024
AMG Quarterly Investor Presentation May 2024
 
Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024Collective Mining | Corporate Presentation - May 2024
Collective Mining | Corporate Presentation - May 2024
 
Nicola Mining Inc. Corporate Presentation May 2024
Nicola Mining Inc. Corporate Presentation May 2024Nicola Mining Inc. Corporate Presentation May 2024
Nicola Mining Inc. Corporate Presentation May 2024
 

sheet 5.docx

  • 1.
  • 2. Ministry of Higher Education Course: File organization- INF 221 Higher Technological Institute Computer Science Department Second Year Sheet 5: Sequential and Direct File Organization Theoretical 1. Define each of the following with example: • Record: Unit of information which contains data about individual entities. • Field: is a decompose atomic unit of the record. 2. Compare between sequential search and direct access? Sequential Search: is a method (algorithm) of searching a file by reading the file from the beginning and continuing until you have read in every thing that you need.  Look at records sequentially until matching record is found. Time is in O(n) for n records.  Appropriate for pattern matching, file with few records. Direct Access: it is based on disk model. It allows random access. User can jump to any record and access that record. Following operations are supported.  Being able to seek directly to the beginning of the record. Time is in O(1) for n records.  Possible when we know the Relative Record Number (RRN): First record has RRN 0, the next has RRN 1, etc. 3. What is the difference between binary and interpolation search? The binary search method requires: •records are stored in a sorted list. •the list is randomly accessible Interpolation search This search algorithm works on the probing position of the required value. For this algorithm to work properly, the data collection should be in a sorted form and equally distributed. 4. Describe in details self organizing sequential search? Self-organizing lists modify the order in which records are stored based on the actual or expected access pattern. The goal is to achieve an ordering that keeps the most frequently sought records closest to the front of the list. Common heuristics: •frequency count: order by the actual historical frequency of access •move-to-front: when a record is accessed, move it to the front of the list •transpose: when a record is accessed, swap it with the preceding record in the list Problems 5. Using binary search for the following sequence to search 18: Programs 6. Write a program for problem 5 by using C or C++. Research
  • 3. 7. Make problem 6 by any IDE for C/C++. with all my best wishes | P a g e 1