module4 and 5 Flashcards
Front
Back
Q45-1: What is sequential file organization?
Sequential file organization stores records one after the other in contiguous disk blocks, making it ideal for batch processing and sequential access.
Q45-2: What is direct (hashed) file organization?
Direct file organization uses a hash function to calculate a record’s disk location, enabling fast direct access but may suffer from clustering and collisions.
Q45-3: What is indexed file organization?
Indexed file organization maintains an index (similar to a table of contents) that maps keys to record locations, providing quick lookup while balancing sequential and random access.
Q45-4: What is clustered file organization?
Clustered organization groups similar records together in blocks to improve data locality and access speed.
Q45-5: What are the advantages of sequential file organization?
It offers a simple design with efficient sequential access, ideal for applications like log processing or batch jobs.
Q45-6: How does direct (hashed) organization compare to indexed organization?
Direct organization provides very fast access through hashing while indexed organization offers structured lookups, though it requires extra storage for the index.
Q45-7: When is each file organization type most appropriate?
Sequential is best for batch processing; direct is suited for random-access databases; indexed works well for balanced performance; clustered is used when related records need to be accessed together.
Q46-1: What is a single-level directory structure?
A single-level directory contains all files in one flat structure, without subdirectories, leading to a simple but potentially cluttered file space.
Q46-2: What is a hierarchical directory structure?
A hierarchical directory structure organizes files into directories and subdirectories, forming a tree-like arrangement that supports better organization and scalability.
Q46-3: What is a disadvantage of a single-level directory?
Single-level directories can lead to name conflicts and become difficult to manage as the number of files increases.
Q46-4: How does a hierarchical directory structure resolve naming conflicts?
By allowing files with the same name to exist in different directories, hierarchical structures eliminate naming conflicts.
Q46-5: What organizational benefit does a hierarchical directory provide?
It groups related files together, making navigation, file retrieval, and management easier and more efficient.
Q46-6: How does file retrieval differ between single-level and hierarchical directories?
Hierarchical directories use structured paths for efficient retrieval, whereas single-level directories require scanning a large, unstructured list.
Q46-7: In what scenarios might a single-level directory be sufficient?
In small systems or environments with few files, a single-level directory is simpler and may suffice.
Q47-1: What is indexed allocation in file systems?
Indexed allocation assigns an index block to each file, which holds pointers to all of the file’s data blocks.
Q47-2: What is the primary advantage of indexed allocation?
It eliminates external fragmentation and supports random access to any file block through the index.
Q47-3: What is a disadvantage of indexed allocation?
Maintaining the index adds overhead, and for large files, the index may require additional multi-level structures.
Q47-4: How does indexed allocation support random access?
The index block allows the system to directly locate any data block without scanning the entire file.
Q47-5: What is external fragmentation and how does indexed allocation address it?
External fragmentation is the scattering of free space; indexed allocation avoids this by keeping file pointers separate from the free space management.
Q47-6: How might the index block become a performance bottleneck?
For very large files, a large or multi-level index may slow down access due to increased lookup complexity.
Q47-7: In what scenarios is indexed allocation particularly useful?
It is especially beneficial in systems where frequent random access is required and minimal fragmentation is desired.