INITO Assignment
INITO Assignment
File system
What
WhatisisFile
Filesystem??
system?? INITO
How to Approch INITO
Tree
Trees are the best suitable data structure to implement this
because nodes and leaves of the tree resemble the directories
and sub-directories containing files in them.
A binary tree cannot do the job here as it restricts to only
why tree ?? why not
having two children. N-ary Tree should be implemented solve
binary tree???....
this. Since we do not know what will be the value of n, each
node cannot have a fixed child links.
INITO
We also a need to traverse upwards to its root. That can be solved by
creating another link with the parent directory. Although this technically INITO
becomes a Graph, but implementation will be like a binary tree in a broad
level and like linked list in a directory level.
Get to Know Them
Structure
of Node
INITO
predefined
Structure
of
directories
INITO
Create a new node
for Directory/File
{Mkdir/touch}
Time complexity of
Remove/delete a node
Time Complexity = O(m*h)
Auxiliary Space = O(1)
where,
n = Total number of nodes
m = number of nodes in a directory INITO
h = height of tree
change directory
{cd}
Time complexity
Time Complexity = O(m*h)
Auxiliary Space = O(1)
where,
n = Total number of nodes
m = number of nodes in a directory
h = height of tree INITO
To copy
file/move file
cp/mv
Time complexity of
Remove/delete a node
Time Complexity = O(m*h)
Auxiliary Space = O(1)
where,
n = Total number of nodes INITO
m = number of nodes in a directory
h = height of tree
INITO
Thank you !!
Have a Nice Day!!!