• Home
  • University of the People
  • Data Structures (proctored course) CS 3303
  • Data Structures - File Processing and External Storing

Data Structures - File Processing and External Storing

Learning Guide Unit 7 Overview Unit 7: File processing and external storing Topics: Primary versus secondary storage Disk drives: architecture and access costs Buffers and Buffer Pools External Sorting Learning Objectives: Understand and be able to articulate the differences between primary and secondary storage including: 0 Computer RAM memory 0 Disk drives and other secondary storage devices 0 The concepts of persistent versus volatile memory 0 Data structures implemented in secondary storage (file structure) Understand the terminology and architecture of disk drives Understand the concept of disk access costs associated with head movement and seek time Understand and be able to implement a buffer cache that incorporates concepts such as: 0 Buffer pool 0 Heuristics including FIFO, LFU, and LRU approaches 0 Virtual memory Understand and be able to implement External sorts and be familiar with key concepts including: 0 Key sorts and index files Quicksort and mergesort implementations 0 0 The replacement selection algorithm 0 Merging Introduction In unit 7, we explore file processing and external sorting algorithms. It is important to understand what storage and when it is important to use each. Internal storage, which is what all of the algorithms and data structures that we have dwelt with so far have used, is the internal memory (often referred to as RAM or random access memory) of the computer. This to say that RAM is orders of magnitude faster than external storage. External storage, on the other hand, doesn't have as much performance, but it does have characteristics such as size and persistence that make it equally as important as internal storage. The following table compares internal and external storage and begins to show why each is so important. Internal Storage External Very fast 100,000 to 1,000,000 times as fast as external storage Slower performance whe storage Cost is high per unit of storage is high when compared with external storage Cost per unit of storage i: Quantity of storage is relatively low when compared with External storage Size of storage is virtuall Data stored is persistent media until erased Data stored is not persistent ... when the power is turned off the data is lost By considering these characteristics we can come to some conclusions. First since internal storage is so internal storage. Sorts conducted in internal storage are much faster than those that must access external storage. In our text, Shaffer leads us to an understanding of disk drive technology, which is the most common form of external storage. Key topics that are introduced include an understanding of the operation of a disk drive and how rotation, disk head movement contributes to the latency of accessing information from the disk drive. This latency 'cost' of accessing data from a disk drive can be mitigated in part through the use of a buffer cache or buffer pool. The basic idea behind the buffer cache is that the disk drive will often read more information in each I/O operation than is required by the program. If this informatio