CL2021 – Object-Oriented Data Structures Lab
Semester Project
Fall 2025
Instructions:
Copied projects will be marked as zero.
Submit your complete project as a .zip [Link] zip file must include:
o Your C++ project code
o The final report (in .pdf format)
Use the format [CourseCode]_[GroupNumber]_[SectionName].pdf.
Upload the .zip file on the designated GCR portal.
Late submissions will not be entertained without prior approval.
Taxonom
LLO No. LLO Statement Domain
y Level
Implement advanced C++ programming concepts
including dynamic memory allocation, operator
1 Psychomotor 3
overloading, inheritance, file handling, exception
handling, templates, and recursion.
Implement linear and non-linear data structures in C++
by performing their fundamental operations, including
2 Psychomotor 3
arrays, linked lists, stacks, queues, trees, heaps, hash
tables, and graphs.
To behave responsibly within team and perform the
3 Affective 2
tasks safely.
File System
You have to implement a file system that should have the following specifications. On the
execution of your code your console should display the following options to the user.
Create a new file.
List & view existing files.
Copy file from windows (*.txt).
Copy file to windows (*.txt).
Modify.
Delete.
Defragmentation (Bonus Feature)
System Initialization
At the initialization of file system, a 10 MB file should be initialized. Your file should be
divided into 3 parts.
1
Figure 1: File_syste
First portion (1MB) of your file “File_system” should be reserved for the file names and
the starting address of the data in the file. It should be subdivided into sub blocks, each of
capacity 500B. In other words, each sub block in the first block (1 MB) of the file should
have a capacity to store file name and starting address which should not exceed 500B.
Second portion (1MB) of your file “File_system” should be reserved for listing the
available empty (vacant) blocks in the third portion.
Third portion (8MB) of your file “File_system” should be reserved for the data to be
written in the files listed in first portion of your “File_system”.
Figure 2: File_system having two file saved as File1 and File2 at location 1000 and 2024
respectively.
Create new file
If the user selects this option, console will prompt the user for:
The name of the text file. After the user enters name of the file, your program should
check whether the file with this name already exist. For example from the above ex-
ample if user wants to create a file with [Link] a message should be displayed “the
file already exists”.
2
The data he wants to write in the text file. User can enter data of unspecified length
(even if greater than a block size i.e. 1024B) your program should cater with this by al-
locating another block from the empty blocks available in second portion of the
File_system.
After taking the data from the user, the program should
Look for the available empty space (from second portion) and write the data
at that location.
Remove that address from the second blockof File_system i.e. block of available
slots.
If thefile “new file” comprises of more than one 1024 MB blocks then each block
should contain the address of the next continuation [Link] in the file should
be delimited by any delimiting character that indicates end of file for that particu-
lar file. For example in figure 2 two files are saved in the file system named File1
and File2 both having data size less than 1024B, thus a single block of 1024B is
allocated to each with a ’/0’ at end that indicates end of file. Suppose the “new
file” comprises of data more than 1024B, then another empty block should be al-
located from the second block of File_system.Each continuation block of the
same file should be linked by adding the address of next block (if any) in the pre-
vious block.
Name of the “new file” and the address location should be updated in the block1
of File_system.
Figure 3: Changes in your File_system that takes place when a new file is created
List & view existingfiles
If the user selects this option, all the names of the files placed in the file system should be
displayed and user should be prompt for the file name he wants to be displayed. In above
scenario, on selecting this option following list should be displayed:
3
1. File1
2. File2
3. New
If the user selects “New” the console should display the data in the file after reading from the
location.i.e. “My new file data exceeds in size”.
Copy File from Windows
This option facilitates the user to copy any file (*.txt) placed on hard disk to this
File_system.The user should specify the file name he wants to copy along with the path and all
the data placed in the file gets copied in the file system. Suppose user wants to copy a file
“[Link]” with content “this is copied data” placed at somewhere in harddisk. After copying
the file from windows to File_system following changes should occur in your File_system .
Figure 4: Changes in your File_system that takes place when an existing file is copied from
windows
Copy File to windows
When a user wants to copy a file from File_system to windows he will select this option. User will
enter the file name he wants to copy and the file gets copied with the name same as that in the
File_system. For example user wants to copy “[Link]” to windows.A new file will be created as
follows while the File_system remains unchanged.
4
Figure 5: File copied from File_system to windows.
Modify File
The user should also be given an option to modify existing files in the File_system. The only
modification user can make in any of the files is concatenation of the data at the end of file. For
example if the user selects “[Link]” to modify your program should prompt for the data he
wants to append in the file.
After the user enters the data it gets appended at the end of already existing data. There may also
be the case that after modification the data of file exceeds 1024B. A continuation block should be
added by allocating a new memory block from second portion of File_system. Let the data
entered by user be “this is my extension file”.This data will be appended in “[Link]” and the
following changes will occur.
Figure 6:Changes that occur in File_system after modification in [Link]
5
Delete
User can also delete any of the file from File_system by giving the file name. If the user wants to
delete
“[Link]” from the File_System the following steps will occur:
Delete the file name from first block of File_system.
Remove the data placed in the data place of “[Link]”.
Add the de allocated blocks in second block(block of empty locations) of File_system.
Figure 7: Changes after deleting a file “[Link]” from File_system
Defragmentation
Considering the above scenario, deletion of “[Link]” resulted in a vacant slot at start and a
vacant slot at end. After many such deletions your File_system may have many vacant blocks in
between the allocated blocks which may results in more computation time. This issue can be
resolved through defragmentation. Once the File_system is subjected to defragmentation all the
occupied blocks will arrange at consecutive locations leaving behind the empty blocks together.
6
Figure 8: File_system before defragmentation
Figure 9: File_system after defragmentation
7
Note:
You have to follow the specifications and features of the file_system mentioned above.
Providing user friendly interface using windows form based application will add bonus marks
to your final project marks.
To avoid complexity file_system is restricted to (*.txt) files only.
Your file system should be designed to minimize time complexity for all major operations. You
must decide which data structures (arrays, linked lists, trees, hash tables, etc.) best meet this goal
— and justify your choice.
GOOD LUCK
8
Assessment Criteria Marks Mapped LLO PLO
System Initialization & File Organization 15 1 5
Data Structure Selection & Justification 15 2 5
File Operations (Create, Delete, Modify) 25 2 5
Searching & Listing Mechanism 10 2 5
Time Efficiency & Complexity Analysis 10 2 5
Defragmentation (Bonus Feature) 5 2 5
Code Quality, Exception Handling, and Documentation 10 1 5
Teamwork, Contribution & Responsible Conduct 10 3 9
Total Marks 100 — —