Problem Statement:
· Implement a memory allocation system that dynamically allocates and frees memory blocks using First Fit and Best Fit algorithms. The system should handle fragmentation through periodic defragmentation.
Objective:
· Design and implement an efficient memory allocation system to manage dynamic memory allocation, optimize space utilization, and minimize fragmentation. Utilize doubly linked lists, binary search trees, and AVL trees for storing and managing memory blocks.
Constraints:
· Memory size ranges from 10 million to 100 million.
· Each memory address is represented as 1 Byte.
· Dynamic memory allocation is used with variants of the First Fit and Best Fit algorithms.
· Fragmentation is handled through periodic defragmentation.
Complexity:
· Doubly linked list implementation: O(n) for Insert, Delete, Find, getFirst, and getNext operations.
· Binary search tree implementation: O(log n) for Allocate and Free operations.
· AVL tree implementation: O(log n) for Allocate, Free, and Defragment operations.