Algorithms File Systems Lab Environment
What makes a good algorithm? Algorithms File Systems Lab Environment What makes a good algorithm?
Algorithms File Systems Lab Environment What is abstraction?
Algorithms File Systems Lab Environment Example Problem Create an address list that includes each person’s name, address, telephone number, and e-mail address This list should then be printed in alphabetical order The names to be included in the list are on scraps of paper and business cards
A Computer Example – a Top Down approach Page 156
A Computer Example Page 157
A Computer Example Page 158
A Computer Example Page 159
A new structure and a new feature of a good algorithm This algorithm features the use of abstraction, that is, removing the detail from a step. Example, first step of main says “enter names into list” This step does not say how; it simply says to do this activity. In another place, we find the detail.
This approach allows us to break a problem solution down into small components allows us to think of each component independently allows reuse
Graphically Enter names in list Fill in missing data Main Enter names in list Fill in missing data Put list in alphabetic order Print the list Our brains can grasp this amount of information. Only 5 things to worry about. Each of those 5 things has more detail but not an overwhelming amount. Prompt for and enter names
What makes a good algorithm? Algorithms File Systems Lab Environment What makes a good algorithm? Exercise
Algorithms File Systems Lab Environment
Algorithms File Systems Lab Environment One of the resources that the operating system manages is auxiliary storage. Some terminology A file is a named collection of related data A file system is the logical view that an operating system provides so that users can manage information as a collection of files A file system is often organized by grouping files into directories
Directory Trees - Windows Algorithms File Systems Lab Environment Directory Trees - Windows
Algorithms File Systems Lab Environment A Unix Directory Tree
A directory of files can be contained within another directory Algorithms File Systems Lab Environment A directory of files can be contained within another directory The directory containing another is usually called the parent directory, and the one inside is called a subdirectory A file system is often viewed as a directory tree The directory at the highest level is called the root directory At any point in time, you can be thought of as working in a particular location (that is, a particular subdirectory) This subdirectory is referred to as the current working directory
A relative path name begins from the current working directory Algorithms File Systems Lab Environment To indicate a particular file using text, we specify that file’s path, which is the series of directories through which you must go to find the file An absolute path name begins at the root and specifies each step down the tree until it reaches the desired file or directory A relative path name begins from the current working directory