Skip to content
GATEiit

GATE CSE 2021 Set 1 Q25: Directory operations needing a full scan of a linear list

Question

Consider a linear list based directory implementation in a file system. Each directory is a list of nodes, where each node contains the file name along with the file metadata, such as the list of pointers to the data blocks. Consider a given directory foo.

Which of the following operations will necessarily require a full scan of foo for successful completion?

Try it: multiple select: one or more correct options

Select one or more options
Select all correct options. No negative marking, no partial marks.
Show answer and explanation

Answer: A, C (official GATE 2021 final answer key)

Concept used: An operation must scan the whole list when it has to prove that a name is not already present.

First step: Creation and renaming must check the new name for duplicates; deletion and opening can stop once the file is found.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2021 Set 1 CS question paper and final answer key, organised by IIT Bombay. Question paper · Answer key