There are many types of structures of directory in the Operating System. The simplest one of them is Single Level Directory structure. In this type of structure, there is one user and there is a single root directory. Inside the root directory, there is a main entry directory responsible for a single file. All the files of the system are contained inside this main root directory. These main directories house all the files in the system. There can be no other sub-directories inside the main directories. Implementation of such a structure is very simple, and searching is also very easy. But this also has a big disadvantage which is that there cannot be two files of the same name. Even if the size of the files remains small, the size of the directory will be huge because a system has thousands of such files and all of these will be inside a single root directory.
Single Level Directory Program In C++
Output of Single Level Directory Program In C++
In the above program, the main () function is used to take the user name from the user. It is also responsible for taking the choice from the user repeatedly till the user enters 0 for exit. Pressing 1 calls the addDir () method which is used to add a directory inside the root folder. Pressing 2 calls the addFile () method, which will take the name of the directory inside which a file has to be created and then the name of the file and then it will create a file inside the respective directory. Pressing 3 will call the displayDirTree () method which will display the directory tree created by the user.
Aayush Kumar Gupta is the founder and creator of ExploringBits, a website dedicated to providing useful content for people passionate about Engineering and Technology. Aayush has completed his Bachelor of Technology (Computer Science & Engineering) from 2018-2022. From July 2022, Aayush has been working as a full-time Devops Engineer.
I have already put my own equation using this program. However, it appear error to me. This is my equation and to solve it, f(x) (x)=x^2*sin(x)*exp(x^2).
Sorry wrong put equation, it’s actually f(x)=x^2*sin(x)*exp(x^2). But still the program became error.