0% found this document useful (0 votes)
27 views

File Structure

The document discusses different file organization methods including sequential, direct access, and indexed sequential access. It defines each method and outlines their advantages and disadvantages. Sequential organization stores records in order, direct access allows random placement and retrieval, while indexed sequential combines both approaches.

Uploaded by

games play
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

File Structure

The document discusses different file organization methods including sequential, direct access, and indexed sequential access. It defines each method and outlines their advantages and disadvantages. Sequential organization stores records in order, direct access allows random placement and retrieval, while indexed sequential combines both approaches.

Uploaded by

games play
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

File Structures

Ph.D. Margarita Gamarra


Uninorte
Topics

● Basic concepts CONCEPTOS BASICOS

○ Storage media MEDIOS DE ALMACENAMIENTOS

○ File types TIPOS DE DATOS

○ Search methods (Sequential, Direct) METODOS DE BUSQUEDAS (SECUENCIALES Y


DIRECTOS)

○ Sequential files operations OPERACIONES DE ARCHIVOS SECUENCIALES

○ File creation CREACION DE ARCHIVOS

○ Update, search and delete records ACTUALIZAR, BUSCAR Y ELIMINAR REGISTROS

● Indexed sequential files ARCHIVOS SECUENCIALES INDEXADOS

● Primary key and secondary keys CLAVE PRIMARIA Y SECUNDARIA

○ Update, search and delete records ACTUALIZAR, BUSCAR Y ELIMINAR REGISTROS

○ Search records by different keys BUSCAR REGISTROS POR DIFERENTES CLAVES


Data structure
Previous concepts: what is an algorithm?
Data structure
● A data structure is defined as a particular way of storing and
organizing data in our devices to use the data efficiently and
effectively.
● The main idea behind using data structures is to minimize the
time and space complexities.
● An efficient data structure takes minimum memory space and
requires minimum time to execute the data.
● Una estructura de datos se define como una forma particular de
almacenar y organizar los datos en nuestros dispositivos para utilizar los
datos de manera eficiente y efectiva.
● La idea principal detrás del uso de estructuras de datos es minimizar las
complejidades del tiempo y el espacio.
● Una estructura de datos eficiente ocupa un espacio de memoria mínimo
y requiere un tiempo mínimo para ejecutar los datos.
Storage media

● Storage media refers to any device that allows data to be stored permanently
● Mechanical or electronic devices
○ Store data= Write data= save a file
○ Recover data = read data= open a file
● Each device is limited by the maximum amount of data that can be stored on it.

https://docs.oracle.com/cd/E19253-01/819-6957/chp-typeopexpr-2/index.html

medios de almacenamiento se refiere a cualquier dispositivo que permite que los datos
se almacenen de forma permanente
● Dispositivos mecánicos o electrónicos
○ Almacenar datos = Escribir datos = guardar un archivo
○ Recuperar datos = leer datos = abrir un archivo
● Cada dispositivo está limitado por la cantidad máxima de datos que se pueden
almacenar en él.
About memory

Tomada de GeeksforGeeksDifference between Primary and Secondary Memory - GeeksforGeeks


About memory
File types

Imagen tomada de https://www.geeknetic.es/Guia/91/Los-archivos-tipos-extensiones-y-programas-para-su-uso.html


File organization

● File organization ensures that records are available for processing. There are three
types of organizing the file:
1. Sequential access file organization
2. Direct access file organization
3. Indexed sequential access file organization

La organización de archivos garantiza que los registros estén disponibles para su procesamiento.
Hay tres tipos de organización del archivo:
1. Organización de archivos de acceso secuencial
2. Organización de archivos de acceso directo
3. Organización de archivos de acceso secuencial indexado
Sequential file organization
• Store and sort in contiguous block within files.
• In sequential access file organization, all records are stored in a
sequential order. The records are arranged in the ascending or
descending order of a key field.
• Sequential file search starts from the beginning of the file and the records
can be added at the end of the file.
• In sequential file, it is not possible to add a record in the middle of the file
without rewriting the file.
Almacenar y ordenar en un bloque contiguo dentro de los archivos.
• En la organización de archivos de acceso secuencial, todos los registros se almacenan en un orden secuencial. Los
registros están organizados en el orden ascendente o descendente de un campo clave.
• La búsqueda secuencial de archivos comienza desde el principio del archivo y los registros se pueden agregar al final
del archivo. • En el archivo secuencial, no es posible añadir un registro en el medio del archivo sin reescribir el archivo.
Sequential file organization

Advantages Disadvantages
• It is simple to program and easy • Sequential file is time consuming
to design. process.
• Sequential file is best use if • It has high data redundancy.
storage space.
• Random searching is not possible.
• This approach is used when a
large number of records must be • After you place a record into a
accessed, such as when sequential file, you cannot shorten,
calculating a student’s grade or lengthen, or delete the record.
generating a wage slip. However, you can update (REWRITE) a
record if the length does not change.
• This strategy is employed in the
creation of reports and statistical
calculations.
Direct Access file organization

• Direct access file is also known as random access or relative file


organization.
• In direct access file, all records are stored in direct access storage
device (DASD), such as hard disk. The records are randomly placed
throughout the file.
• The records does not need to be in sequence because they are
updated directly and rewritten back in the same location.
• This file organization is useful for immediate access to large amount
of information. It is used in accessing large databases.
Direct Access file organization

Advantages Disadvantages
• Direct access file helps in online • Direct access file does not provide back
transaction processing system up facility.
(OLTP) like online railway
reservation system. • Implementation of direct-access
systems is often difficult because of the
• In direct access file, sorting of the complexity and the high level of
records are not required. programming (software) support that
such systems need. In addition, the
• It accesses the desired records cost of developing and maintaining a
immediately. direct-access system is greater than
• It updates several files quickly. the expense of a sequential processing
system.
• It has better control over record
allocation. • It has less storage space as compared
to sequential file.
Indexed sequential access file
organization
• Indexed sequential access file combines both sequential file and
direct access file organization.
• In indexed sequential access file, records are stored randomly on a
direct access device such as magnetic disk by a primary key.
• The data can be access either sequentially or randomly using the
index. The index is stored in a file and read into memory when the
file is opened.
Indexed sequential access file
organization

Advantages Disadvantages
• In indexed sequential access file, • Indexed sequential access file requires
sequential file and random file unique keys and periodic
access is possible. reorganization.
• It accesses the records very fast if • Indexed sequential access file takes
the index table is properly longer time to search the index for the
organized. data access or retrieval.
• The records can be inserted in the • It requires more storage space.
middle of the file.
• It is expensive because it requires
• It provides quick access for special software.
sequential and direct processing.
• It is less efficient in the use of storage
• It reduces the degree of the space as compared to other file
sequential search. organizations.
Indexed sequential access file organization

Imagen tomada de
https://www.researchgate.net/publication/273380260_ADMINISTRACION_DE_ARCHIVOS_Ejemplos_practicos_de_utilizacion_de_archivos_Secuenciales_Indexados_y_directos_utilizando_el_lenguaje_C/figures?
lo=1&utm_source=google&utm_medium=organic
Referencias
● https://www.geeksforgeeks.org/learn-data-structures-and-algorithms-dsa-tutorial/
● https://www.tutorialride.com/data-structures/file-organization-in-data-structure.htm
● https://www.ibm.com/docs/en/cobol-aix/5.1?topic=mode-file-organization-access
● https://byjus.com/gate/sequential-file-organization-in-dbms-notes/

You might also like