SlideShare a Scribd company logo
1 of 46
MINIMIZE      MAXIMIZE
ACCESS TIME   SPACE USAGE
    ???           ???
One trip
Minimum
  trips
Sending
Related
  data
Why not Data
Structures???
So when we have a huge data,
 We can use file structures to
access them quickly , thereby
 making it more efficient than
       data structures.
Data Management in Files




       USN : 1MS10ISO34
      Name : Dileep Kodira
         College : MSRIT
        Place : Bangalore
FIXED LENGTH FIELDS - force the
   fields into predicable (fixed) length
     FOUR MOST
LENGTH INDICATOR FIELDS -begin
     COMMON WAYS
each field with the length indicator
     OF STRUCTURING at the
DELIMITED FIELDS - place delimiter
     FIELDS ARE
end of each field to separate the fields
  SELF-DESCRIBING FIELDS- use
  “keyword=value” expression to identify
  each field and its contents
Fixing the Length of Fields
• This method relies on creating fields of
  predictable fixed size.
• E.G. One may define the following class:
        class Person {
        public:
          char last[11];
          char first[11];
          char address[16];
          char city[16];
          char state[3];
          char zip[10];
        }
Fixing the Length of Fields
• Disadvantages:
     • a lot of wasted space due to “padding” of fields
       with “blanks”
     • data values may not fit into the field sizes:
            » e.g. Michalopoulos is too long to fit in the array
              char last[11]

• Thus the fixed-size field approach is
  inappropriate for data that inherently
  contains a large amount of variability in the
  length of fields such as names or addresses.
Beginning Each Field with a
         Length Indicator
• This method requires that each field data
  be preceded with an indicator of its length
  (in bytes).
E.G.
 04Ames04Mary09123 Maple10StillWater02OK0574075
• One of the disadvantages of this method is that it
  is more complex since it requires extracting of
  numbers and strings from a single string
  representing a record.
Separating Fields with
            Delimiters
• This method requires that the fields be
  separated by a selected special character or
  a sequence of characters called a delimiter.
• E.G. If “|” is used as a delimiter then a
  sample record would look like this:
  Ames|Mary|123Maple|StillWater|OK|574075|
Separating Fields with
            Delimiters
• The method of separating fields with a
  delimiter is often used. However choosing a
  right delimiter is very important.

• In many cases white-space characters
  (blanks) are excellent delimiters because
  they provide a clean separation between
  fields when we list them on the console.
Using a “keyword = value” expression
• This method requires that each field data be
  preceded with the field identifier (keyword).
E.G.
  last=Amesfirst=Maryaddress=123
  Maplecity=StillWaterstate=OKzip=574075
• Can be used with the delimiter method to
  mark the field ends.
  last=Ames|first=Mary|address=123
  Maple|City=StillWater|state=OK|zip=574075
Using a “keyword = value” expression

• Advantages:
     • each field provides information about itself
     • good format for dealing with missing fields


• Disadvantages:
     • In some application a lot of space may be wasted on
       field keywords (up 50%).
Record Structures
• Files may be viewed as collections of records
  which are sets of fields
• Some of the most often used methods for
  organizing the records of a file are:
   – require that the records be a predictable (fixed)
     number of bytes in length
   – require that the records be a predicable
     number of fields in length
Organizing the Records of a File
 – begin each record with its length indicator
   (count of the of bytes in the record)
 – use a second file to keep track of the beginning
   byte address for each record
 – place a delimiter at the end of each record to
   separate it from the next record
Fixed-Length Records
• This method is a counterpart of is
  analogous method for organizing files with
  fix length fields.
• Fixing the sizes of fields in a record will
  produce a fixed-size record.
Fixed-Length Records
• E.G.
         class Person {
         public:
           char last[11];
           char first[11];
           char address[16];
           char city[16];
           char state[3];
           char zip[10];
         }
         Will produce a fixed size record of size 67 bytes.
Fixed-Length Records
• The fixed length record structure, however,
  does NOT imply, the fixed -length field
  structure.
• Fixed-length records are frequently used as
  “containers” to hold variable numbers of
  variable-length fields.
• Fixed-length record structures are among
  the most commonly used methods for
  organizing files.
Records with a Predicable
         Number of Fields
• The method specifies the number of fields
  in each record.
• Regardless of the method for storing fields,
  this approach allows for relatively easy
  means for calculating record boundaries.
Records with a Length Indicator

• This method requires that each record
  begin with a length indicator.

• This method is commonly used for handling
  variable-length records.
Index File to Keep Track of
        Record Addresses

• This method uses an index file (or an index
  block) to keep a byte offset for each record
  in the original data file. The byte offsets
  (record addresses) allow us to find the
  beginning of each successive record and
  compute the length of each record.
Records Separated with
            Delimiters
• This method is analogous to the use of
  delimiters to separate fields.
• As with fields the delimiter must be well
  chosen and it cannot be a part of data.
• Common delimiter is the end-of-line
  character ‘n’, since records often are read
  directly to the console.
A Record Structure that Uses a
       Length Indicator
• Use a memory buffer to store the data that
  is going to be written to the disk.
• Write down the size of the record at the
  beginning of it.
• Write down the buffer contents after
  writing the size.
Name : Dileep
                 FIELDS
                RECORDS


                 USN : 1MS10IS034
                 USN : 1MS10ISO34
                    Name : Dileep
                  USN : 1MS10IS034
                   College Dileep
                    Name : : MSRIT
                     Name : Dileep
                        Kodira
                  Place : Bangalore
                    College : MSRIT
                   College : MSRIT
                   Place : Bangalore
                  Place : Bangalore
USN : 1MS10IS034
Name : Dileep Kodira
  College : MSRIT
 Place : Bangalore
USN :
  1MS10IS034
 Name : Dileep
     Kodira
College : MSRIT
     Place :
   Bangalore
UNPACKING



        Name : Dileep
     USN : 1MS10IS034
       Name : Dileep
      College : MSRIT
     Place : Bangalore
RUN LENGTH ENCODING
 – Represents data using value and run length
 – Run length defined as number of consecutive equal
   values

              RLE
 1110011111         130215

                                Run Lengths

                       Values
RUN LENGTH ENCODING
Applications
• Useful for compressing data that contains
  repeated values
  – e.g. output from a filter, many consecutive values are
    0.
• Very simple compared with other compression
  techniques
• Reversible (Lossless) compression
  – decompression is just as easy
MORSE CODING

 REPRESENTS ANY ALPHA-NUMERICAL
  CHARACTER USING TWO SYMBOLS
AND VERIETY OF SPACES BETWEEN THEM
HUFFMAN CODING
• Suppose we have a message consisting of 5 symbols, e.g.
  [                   ]
• How can we code this message using 0/1 so the coded
  message will have minimum length (for transmission or
  saving!)

• 5 symbols  at least 3 bits
• For a simple encoding,
 length of code is 10*3=30 bits
HUFFMAN CODING
• Intuition: Those symbols that are more frequent should have
  smaller codes, yet since their length is not the same, there
  must be a way of distinguishing each code

• For Huffman code,
length of encoded message
will be
=3*2 +3*2+2*2+3+3=24bits
Thank you




            Dileep Kodira

More Related Content

What's hot

Automata theory - CFG and normal forms
Automata theory - CFG and normal formsAutomata theory - CFG and normal forms
Automata theory - CFG and normal formsAkila Krishnamoorthy
 
Transposition cipher techniques
Transposition cipher techniquesTransposition cipher techniques
Transposition cipher techniquesSHUBHA CHATURVEDI
 
Query optimization in SQL
Query optimization in SQLQuery optimization in SQL
Query optimization in SQLAbdul Rehman
 
Algorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching AlgorithmsAlgorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching AlgorithmsMohamed Loey
 
Unit 4 external sorting
Unit 4   external sortingUnit 4   external sorting
Unit 4 external sortingDrkhanchanaR
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management systemPooja Dixit
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMSkoolkampus
 
File organization
File organizationFile organization
File organizationGokul017
 
Data Mining: Application and trends in data mining
Data Mining: Application and trends in data miningData Mining: Application and trends in data mining
Data Mining: Application and trends in data miningDataminingTools Inc
 
Multiversion Concurrency Control Techniques
Multiversion Concurrency Control TechniquesMultiversion Concurrency Control Techniques
Multiversion Concurrency Control TechniquesRaj vardhan
 

What's hot (20)

Inverted index
Inverted indexInverted index
Inverted index
 
File structures
File structuresFile structures
File structures
 
Temporal data mining
Temporal data miningTemporal data mining
Temporal data mining
 
Automata theory - CFG and normal forms
Automata theory - CFG and normal formsAutomata theory - CFG and normal forms
Automata theory - CFG and normal forms
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
File Organization
File OrganizationFile Organization
File Organization
 
Transposition cipher techniques
Transposition cipher techniquesTransposition cipher techniques
Transposition cipher techniques
 
Hive(ppt)
Hive(ppt)Hive(ppt)
Hive(ppt)
 
Query optimization in SQL
Query optimization in SQLQuery optimization in SQL
Query optimization in SQL
 
Algorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching AlgorithmsAlgorithms Lecture 6: Searching Algorithms
Algorithms Lecture 6: Searching Algorithms
 
Unit 4 external sorting
Unit 4   external sortingUnit 4   external sorting
Unit 4 external sorting
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
 
Text MIning
Text MIningText MIning
Text MIning
 
File organization
File organizationFile organization
File organization
 
Data Mining: Application and trends in data mining
Data Mining: Application and trends in data miningData Mining: Application and trends in data mining
Data Mining: Application and trends in data mining
 
File organization
File organizationFile organization
File organization
 
Multiversion Concurrency Control Techniques
Multiversion Concurrency Control TechniquesMultiversion Concurrency Control Techniques
Multiversion Concurrency Control Techniques
 
Specification-of-tokens
Specification-of-tokensSpecification-of-tokens
Specification-of-tokens
 
File organisation
File organisationFile organisation
File organisation
 

Viewers also liked

Discussion : File structure of Meteor Apps
Discussion : File structure of Meteor AppsDiscussion : File structure of Meteor Apps
Discussion : File structure of Meteor AppsSangwon Lee
 
Ie Storage, Multimedia And File Organization
Ie   Storage, Multimedia And File OrganizationIe   Storage, Multimedia And File Organization
Ie Storage, Multimedia And File OrganizationMISY
 
Disk structure & File Handling
Disk structure & File HandlingDisk structure & File Handling
Disk structure & File HandlingMomina Idrees
 
Gps file structure explained
Gps file structure explainedGps file structure explained
Gps file structure explainedJaap Oosterhoff
 
OS - File Handling
OS - File HandlingOS - File Handling
OS - File Handlingvinay arora
 
04.01 file organization
04.01 file organization04.01 file organization
04.01 file organizationBishal Ghimire
 
storage and file structure
storage and file structurestorage and file structure
storage and file structureSheshan Sheniwal
 
register file structure of PIC controller
register file structure of PIC controllerregister file structure of PIC controller
register file structure of PIC controllerNirbhay Singh
 
File organization and processing
File organization and processingFile organization and processing
File organization and processingburhan123456
 
Ch 1-final-file organization from korth
Ch 1-final-file organization from korthCh 1-final-file organization from korth
Ch 1-final-file organization from korthRupali Rana
 
Concept of computer files for Grade 12 learners
Concept of computer files for Grade 12 learnersConcept of computer files for Grade 12 learners
Concept of computer files for Grade 12 learnerswellingtonoboh
 
File organization techniques
File organization techniquesFile organization techniques
File organization techniquesMeghlal Khan
 

Viewers also liked (20)

Discussion : File structure of Meteor Apps
Discussion : File structure of Meteor AppsDiscussion : File structure of Meteor Apps
Discussion : File structure of Meteor Apps
 
CS215 - Lec 2 file organization
CS215 - Lec 2   file organizationCS215 - Lec 2   file organization
CS215 - Lec 2 file organization
 
Ie Storage, Multimedia And File Organization
Ie   Storage, Multimedia And File OrganizationIe   Storage, Multimedia And File Organization
Ie Storage, Multimedia And File Organization
 
Disk structure & File Handling
Disk structure & File HandlingDisk structure & File Handling
Disk structure & File Handling
 
Gps file structure explained
Gps file structure explainedGps file structure explained
Gps file structure explained
 
CS215 - Lec 9 indexing and reclaiming space in files
CS215 - Lec 9  indexing and reclaiming space in filesCS215 - Lec 9  indexing and reclaiming space in files
CS215 - Lec 9 indexing and reclaiming space in files
 
File structure
File structureFile structure
File structure
 
OS - File Handling
OS - File HandlingOS - File Handling
OS - File Handling
 
File structure
File structureFile structure
File structure
 
04.01 file organization
04.01 file organization04.01 file organization
04.01 file organization
 
storage and file structure
storage and file structurestorage and file structure
storage and file structure
 
register file structure of PIC controller
register file structure of PIC controllerregister file structure of PIC controller
register file structure of PIC controller
 
File organization and processing
File organization and processingFile organization and processing
File organization and processing
 
Ch 1-final-file organization from korth
Ch 1-final-file organization from korthCh 1-final-file organization from korth
Ch 1-final-file organization from korth
 
Concept of computer files for Grade 12 learners
Concept of computer files for Grade 12 learnersConcept of computer files for Grade 12 learners
Concept of computer files for Grade 12 learners
 
File organization techniques
File organization techniquesFile organization techniques
File organization techniques
 
Handling computer files
Handling computer filesHandling computer files
Handling computer files
 
Digital Search Tree
Digital Search TreeDigital Search Tree
Digital Search Tree
 
File organization
File organizationFile organization
File organization
 
File handling
File handlingFile handling
File handling
 

Similar to Maximizing Efficiency with File Structures

embedded system-Memory_Organization_final.pdf
embedded system-Memory_Organization_final.pdfembedded system-Memory_Organization_final.pdf
embedded system-Memory_Organization_final.pdfSarveshPandey64
 
cache memory introduction, level, function
cache memory introduction, level, functioncache memory introduction, level, function
cache memory introduction, level, functionTeddyIswahyudi1
 
Dremel interactive analysis of web scale datasets
Dremel interactive analysis of web scale datasetsDremel interactive analysis of web scale datasets
Dremel interactive analysis of web scale datasetsCarl Lu
 
04_Cache Memory.ppt
04_Cache Memory.ppt04_Cache Memory.ppt
04_Cache Memory.pptShiva340703
 
3-Application Layer.pptx
3-Application Layer.pptx3-Application Layer.pptx
3-Application Layer.pptxSachinDUpadhye
 
Unit v memory & programmable logic devices
Unit v   memory & programmable logic devicesUnit v   memory & programmable logic devices
Unit v memory & programmable logic devicesKanmaniRajamanickam
 
Cache Memory for Computer Architecture.ppt
Cache Memory for Computer Architecture.pptCache Memory for Computer Architecture.ppt
Cache Memory for Computer Architecture.pptrularofclash69
 
INT 222.pptx
INT 222.pptxINT 222.pptx
INT 222.pptxSaunya2
 
16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf3operatordcslipiPeng
 
Microcontroller.pptx
Microcontroller.pptxMicrocontroller.pptx
Microcontroller.pptxSaba651353
 

Similar to Maximizing Efficiency with File Structures (20)

embedded system-Memory_Organization_final.pdf
embedded system-Memory_Organization_final.pdfembedded system-Memory_Organization_final.pdf
embedded system-Memory_Organization_final.pdf
 
MySql
MySqlMySql
MySql
 
cache memory introduction, level, function
cache memory introduction, level, functioncache memory introduction, level, function
cache memory introduction, level, function
 
Dremel interactive analysis of web scale datasets
Dremel interactive analysis of web scale datasetsDremel interactive analysis of web scale datasets
Dremel interactive analysis of web scale datasets
 
CS215 - Lec 6 record index
CS215 - Lec 6  record indexCS215 - Lec 6  record index
CS215 - Lec 6 record index
 
CAO-Unit-III.pptx
CAO-Unit-III.pptxCAO-Unit-III.pptx
CAO-Unit-III.pptx
 
FS Mod2@AzDOCUMENTS.in.pdf
FS Mod2@AzDOCUMENTS.in.pdfFS Mod2@AzDOCUMENTS.in.pdf
FS Mod2@AzDOCUMENTS.in.pdf
 
Application layer : DNS
Application layer : DNSApplication layer : DNS
Application layer : DNS
 
Application Layer.pptx
Application Layer.pptxApplication Layer.pptx
Application Layer.pptx
 
04_Cache Memory.ppt
04_Cache Memory.ppt04_Cache Memory.ppt
04_Cache Memory.ppt
 
3-Application Layer.pptx
3-Application Layer.pptx3-Application Layer.pptx
3-Application Layer.pptx
 
Compression techniques
Compression techniquesCompression techniques
Compression techniques
 
Unit v memory & programmable logic devices
Unit v   memory & programmable logic devicesUnit v   memory & programmable logic devices
Unit v memory & programmable logic devices
 
The Internet Protocol version 4 (IPv4)
The Internet Protocol version 4 (IPv4)The Internet Protocol version 4 (IPv4)
The Internet Protocol version 4 (IPv4)
 
Cache mapping
Cache mappingCache mapping
Cache mapping
 
Cache Memory for Computer Architecture.ppt
Cache Memory for Computer Architecture.pptCache Memory for Computer Architecture.ppt
Cache Memory for Computer Architecture.ppt
 
INT 222.pptx
INT 222.pptxINT 222.pptx
INT 222.pptx
 
16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf16119 - Get to Know Your Data Sets (1).pdf
16119 - Get to Know Your Data Sets (1).pdf
 
IPV4 addresses
IPV4 addressesIPV4 addresses
IPV4 addresses
 
Microcontroller.pptx
Microcontroller.pptxMicrocontroller.pptx
Microcontroller.pptx
 

Recently uploaded

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 

Recently uploaded (20)

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 

Maximizing Efficiency with File Structures

  • 1.
  • 2.
  • 3.
  • 4.
  • 5. MINIMIZE MAXIMIZE ACCESS TIME SPACE USAGE ??? ???
  • 9.
  • 10.
  • 11.
  • 12.
  • 14.
  • 15. So when we have a huge data, We can use file structures to access them quickly , thereby making it more efficient than data structures.
  • 16. Data Management in Files USN : 1MS10ISO34 Name : Dileep Kodira College : MSRIT Place : Bangalore
  • 17. FIXED LENGTH FIELDS - force the fields into predicable (fixed) length FOUR MOST LENGTH INDICATOR FIELDS -begin COMMON WAYS each field with the length indicator OF STRUCTURING at the DELIMITED FIELDS - place delimiter FIELDS ARE end of each field to separate the fields SELF-DESCRIBING FIELDS- use “keyword=value” expression to identify each field and its contents
  • 18. Fixing the Length of Fields • This method relies on creating fields of predictable fixed size. • E.G. One may define the following class: class Person { public: char last[11]; char first[11]; char address[16]; char city[16]; char state[3]; char zip[10]; }
  • 19. Fixing the Length of Fields • Disadvantages: • a lot of wasted space due to “padding” of fields with “blanks” • data values may not fit into the field sizes: » e.g. Michalopoulos is too long to fit in the array char last[11] • Thus the fixed-size field approach is inappropriate for data that inherently contains a large amount of variability in the length of fields such as names or addresses.
  • 20. Beginning Each Field with a Length Indicator • This method requires that each field data be preceded with an indicator of its length (in bytes). E.G. 04Ames04Mary09123 Maple10StillWater02OK0574075 • One of the disadvantages of this method is that it is more complex since it requires extracting of numbers and strings from a single string representing a record.
  • 21. Separating Fields with Delimiters • This method requires that the fields be separated by a selected special character or a sequence of characters called a delimiter. • E.G. If “|” is used as a delimiter then a sample record would look like this: Ames|Mary|123Maple|StillWater|OK|574075|
  • 22. Separating Fields with Delimiters • The method of separating fields with a delimiter is often used. However choosing a right delimiter is very important. • In many cases white-space characters (blanks) are excellent delimiters because they provide a clean separation between fields when we list them on the console.
  • 23. Using a “keyword = value” expression • This method requires that each field data be preceded with the field identifier (keyword). E.G. last=Amesfirst=Maryaddress=123 Maplecity=StillWaterstate=OKzip=574075 • Can be used with the delimiter method to mark the field ends. last=Ames|first=Mary|address=123 Maple|City=StillWater|state=OK|zip=574075
  • 24. Using a “keyword = value” expression • Advantages: • each field provides information about itself • good format for dealing with missing fields • Disadvantages: • In some application a lot of space may be wasted on field keywords (up 50%).
  • 25. Record Structures • Files may be viewed as collections of records which are sets of fields • Some of the most often used methods for organizing the records of a file are: – require that the records be a predictable (fixed) number of bytes in length – require that the records be a predicable number of fields in length
  • 26. Organizing the Records of a File – begin each record with its length indicator (count of the of bytes in the record) – use a second file to keep track of the beginning byte address for each record – place a delimiter at the end of each record to separate it from the next record
  • 27. Fixed-Length Records • This method is a counterpart of is analogous method for organizing files with fix length fields. • Fixing the sizes of fields in a record will produce a fixed-size record.
  • 28. Fixed-Length Records • E.G. class Person { public: char last[11]; char first[11]; char address[16]; char city[16]; char state[3]; char zip[10]; } Will produce a fixed size record of size 67 bytes.
  • 29. Fixed-Length Records • The fixed length record structure, however, does NOT imply, the fixed -length field structure. • Fixed-length records are frequently used as “containers” to hold variable numbers of variable-length fields. • Fixed-length record structures are among the most commonly used methods for organizing files.
  • 30. Records with a Predicable Number of Fields • The method specifies the number of fields in each record. • Regardless of the method for storing fields, this approach allows for relatively easy means for calculating record boundaries.
  • 31. Records with a Length Indicator • This method requires that each record begin with a length indicator. • This method is commonly used for handling variable-length records.
  • 32. Index File to Keep Track of Record Addresses • This method uses an index file (or an index block) to keep a byte offset for each record in the original data file. The byte offsets (record addresses) allow us to find the beginning of each successive record and compute the length of each record.
  • 33. Records Separated with Delimiters • This method is analogous to the use of delimiters to separate fields. • As with fields the delimiter must be well chosen and it cannot be a part of data. • Common delimiter is the end-of-line character ‘n’, since records often are read directly to the console.
  • 34. A Record Structure that Uses a Length Indicator • Use a memory buffer to store the data that is going to be written to the disk. • Write down the size of the record at the beginning of it. • Write down the buffer contents after writing the size.
  • 35. Name : Dileep FIELDS RECORDS USN : 1MS10IS034 USN : 1MS10ISO34 Name : Dileep USN : 1MS10IS034 College Dileep Name : : MSRIT Name : Dileep Kodira Place : Bangalore College : MSRIT College : MSRIT Place : Bangalore Place : Bangalore
  • 36. USN : 1MS10IS034 Name : Dileep Kodira College : MSRIT Place : Bangalore
  • 37.
  • 38. USN : 1MS10IS034 Name : Dileep Kodira College : MSRIT Place : Bangalore
  • 39. UNPACKING Name : Dileep USN : 1MS10IS034 Name : Dileep College : MSRIT Place : Bangalore
  • 40.
  • 41. RUN LENGTH ENCODING – Represents data using value and run length – Run length defined as number of consecutive equal values RLE 1110011111 130215 Run Lengths Values
  • 42. RUN LENGTH ENCODING Applications • Useful for compressing data that contains repeated values – e.g. output from a filter, many consecutive values are 0. • Very simple compared with other compression techniques • Reversible (Lossless) compression – decompression is just as easy
  • 43. MORSE CODING REPRESENTS ANY ALPHA-NUMERICAL CHARACTER USING TWO SYMBOLS AND VERIETY OF SPACES BETWEEN THEM
  • 44. HUFFMAN CODING • Suppose we have a message consisting of 5 symbols, e.g. [ ] • How can we code this message using 0/1 so the coded message will have minimum length (for transmission or saving!) • 5 symbols  at least 3 bits • For a simple encoding, length of code is 10*3=30 bits
  • 45. HUFFMAN CODING • Intuition: Those symbols that are more frequent should have smaller codes, yet since their length is not the same, there must be a way of distinguishing each code • For Huffman code, length of encoded message will be =3*2 +3*2+2*2+3+3=24bits
  • 46. Thank you Dileep Kodira

Editor's Notes

  1. Any writer or designer will tell you that 90% of the creative process…