SlideShare a Scribd company logo

sheet 5.docx

dadass

sheet 5.docx

1 of 4
Download to read offline
sheet 5.docx
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

Recommended

FIle Organization.pptx
FIle Organization.pptxFIle Organization.pptx
FIle Organization.pptxSreenivas R
 
File Structure.pptx
File Structure.pptxFile Structure.pptx
File Structure.pptxzedd15
 
File organization 1
File organization 1File organization 1
File organization 1Rupali Rana
 
fileorganizationandintroductionofdbms-210313163900.pdf
fileorganizationandintroductionofdbms-210313163900.pdffileorganizationandintroductionofdbms-210313163900.pdf
fileorganizationandintroductionofdbms-210313163900.pdfFraolUmeta
 
File organization and introduction of DBMS
File organization and introduction of DBMSFile organization and introduction of DBMS
File organization and introduction of DBMSVrushaliSolanke
 
The Neuroscience Information Framework: Establishing a practical semantic fra...
The Neuroscience Information Framework: Establishing a practical semantic fra...The Neuroscience Information Framework: Establishing a practical semantic fra...
The Neuroscience Information Framework: Establishing a practical semantic fra...Neuroscience Information Framework
 

More Related Content

Similar to sheet 5.docx

Chapter 3 Indexing Structure.pdf
Chapter 3 Indexing Structure.pdfChapter 3 Indexing Structure.pdf
Chapter 3 Indexing Structure.pdfJemalNesre1
 
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 hashingRohit Kumar
 
Callahan princetonenug2011
Callahan princetonenug2011Callahan princetonenug2011
Callahan princetonenug2011ENUG
 
Boolean Retrieval
Boolean RetrievalBoolean Retrieval
Boolean Retrievalmghgk
 
Application portfolio development.advadisadvan.pptx
Application portfolio development.advadisadvan.pptxApplication portfolio development.advadisadvan.pptx
Application portfolio development.advadisadvan.pptxAmanJain384694
 
score based ranking of documents
score based ranking of documentsscore based ranking of documents
score based ranking of documentsKriti Khanna
 
Techniques of information retrieval
Techniques of information retrieval Techniques of information retrieval
Techniques of information retrieval Tariq Hassan
 
Unit ivos - file systems
Unit ivos - file systemsUnit ivos - file systems
Unit ivos - file systemsdonny101
 
Data structure and algorithms
Data structure and algorithmsData structure and algorithms
Data structure and algorithmstechnologygyan
 
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 Neo4jSimon Jupp
 
Survey of natural language processing(midp2)
Survey of natural language processing(midp2)Survey of natural language processing(midp2)
Survey of natural language processing(midp2)Tariqul islam
 

Similar to 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
 
File organisation
File organisationFile organisation
File organisation
 
SearchAlgorithm.pdf
SearchAlgorithm.pdfSearchAlgorithm.pdf
SearchAlgorithm.pdf
 
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
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
 
Survey of natural language processing(midp2)
Survey of natural language processing(midp2)Survey of natural language processing(midp2)
Survey of natural language processing(midp2)
 
NETTAB 2013
NETTAB 2013NETTAB 2013
NETTAB 2013
 

More from MohamedAyman183185

More from MohamedAyman183185 (13)

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
 
Temp. sheet 1& Modelnawer[1].docx
Temp.  sheet 1& Modelnawer[1].docxTemp.  sheet 1& Modelnawer[1].docx
Temp. sheet 1& Modelnawer[1].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
 

Recently uploaded

Solaris Resources - February 2024-Investor Presentation
Solaris Resources - February 2024-Investor PresentationSolaris Resources - February 2024-Investor Presentation
Solaris Resources - February 2024-Investor PresentationJacquelineWagenaar1
 
SE India Presentation 2016_Corpotate .pdf
SE India Presentation 2016_Corpotate .pdfSE India Presentation 2016_Corpotate .pdf
SE India Presentation 2016_Corpotate .pdfKumarPiyush50
 
self introduction ad21045 sahana ....
self introduction    ad21045 sahana ....self introduction    ad21045 sahana ....
self introduction ad21045 sahana ....addhivya3014
 
Thermal Energy - Small Cap Growth Conference - February 2024
Thermal Energy - Small Cap Growth Conference - February 2024Thermal Energy - Small Cap Growth Conference - February 2024
Thermal Energy - Small Cap Growth Conference - February 2024Marketing847413
 
Corporate Presentation Probe Gold PEA Feb 2024 Final.pdf
Corporate Presentation Probe Gold PEA Feb 2024 Final.pdfCorporate Presentation Probe Gold PEA Feb 2024 Final.pdf
Corporate Presentation Probe Gold PEA Feb 2024 Final.pdfProbe Gold
 
Collective Mining Limited - Corporate Presentation | February 2024
Collective Mining Limited - Corporate Presentation | February 2024Collective Mining Limited - Corporate Presentation | February 2024
Collective Mining Limited - Corporate Presentation | February 2024CollectiveMining1
 
Companies (Listing of Equity Shares in permissible Jurisdictions) Rules, 2024
Companies (Listing of Equity Shares in permissible Jurisdictions) Rules, 2024Companies (Listing of Equity Shares in permissible Jurisdictions) Rules, 2024
Companies (Listing of Equity Shares in permissible Jurisdictions) Rules, 2024HetalMaheshwari4
 

Recently uploaded (8)

Solaris Resources - February 2024-Investor Presentation
Solaris Resources - February 2024-Investor PresentationSolaris Resources - February 2024-Investor Presentation
Solaris Resources - February 2024-Investor Presentation
 
SE India Presentation 2016_Corpotate .pdf
SE India Presentation 2016_Corpotate .pdfSE India Presentation 2016_Corpotate .pdf
SE India Presentation 2016_Corpotate .pdf
 
self introduction ad21045 sahana ....
self introduction    ad21045 sahana ....self introduction    ad21045 sahana ....
self introduction ad21045 sahana ....
 
Thermal Energy - Small Cap Growth Conference - February 2024
Thermal Energy - Small Cap Growth Conference - February 2024Thermal Energy - Small Cap Growth Conference - February 2024
Thermal Energy - Small Cap Growth Conference - February 2024
 
exicon 092870 Algorithm Investment Report
exicon 092870 Algorithm Investment Reportexicon 092870 Algorithm Investment Report
exicon 092870 Algorithm Investment Report
 
Corporate Presentation Probe Gold PEA Feb 2024 Final.pdf
Corporate Presentation Probe Gold PEA Feb 2024 Final.pdfCorporate Presentation Probe Gold PEA Feb 2024 Final.pdf
Corporate Presentation Probe Gold PEA Feb 2024 Final.pdf
 
Collective Mining Limited - Corporate Presentation | February 2024
Collective Mining Limited - Corporate Presentation | February 2024Collective Mining Limited - Corporate Presentation | February 2024
Collective Mining Limited - Corporate Presentation | February 2024
 
Companies (Listing of Equity Shares in permissible Jurisdictions) Rules, 2024
Companies (Listing of Equity Shares in permissible Jurisdictions) Rules, 2024Companies (Listing of Equity Shares in permissible Jurisdictions) Rules, 2024
Companies (Listing of Equity Shares in permissible Jurisdictions) Rules, 2024
 

sheet 5.docx

  • 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