CIS 2500 Lecture Notes - Lecture 18: Sequential Access, Linked List, C Dynamic Memory Allocation

30 views4 pages

Document Summary

Disk files can be treated as data structures where the data is stored on disk instead of in memory. Using sequential access, the file is similar to a list. You read through all the elements in order. Using random access files is similar to an array. You directly access an element with one read. The potential to create an adt is obvious. The file operations can be hidden behind set, get, create, and destroy function calls. (file mode is very important) (our friend size of) Similar to the next pointers in a linked list structure in memory. Keep a next counter in the structure that you write to disk that contains the record number of the next element. Q: how do you find each of the elements: you must calculate the location of an element and then use fseek() to go to its location. Second approach (one we do in the assignment because deb is evil)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents