 Data Structures and Algorithms 
with Object-Oriented Design Patterns in C++
Data Structures and Algorithms 
with Object-Oriented Design Patterns in C++ 
  
  
  
  
 
 by making suitable variations of the SinglyLinkedPool
	class declared in Program
	by making suitable variations of the SinglyLinkedPool
	class declared in Program  .
	Hint:
	Use a simulation program
	such as the one given in Program
.
	Hint:
	Use a simulation program
	such as the one given in Program  .
. by providing suitable definitions for the following member functions:
	Unlink and InsertAfter.
	Write a test program and test your implementation.
	by providing suitable definitions for the following member functions:
	Unlink and InsertAfter.
	Write a test program and test your implementation. by providing suitable definitions for the following member functions:
	Unlink and InsertAfter.
	Write a test program and test your implementation.
	by providing suitable definitions for the following member functions:
	Unlink and InsertAfter.
	Write a test program and test your implementation.Pool& p = *new SinglyLinkedPool (8192); Pool& q = *new (p) SinglyLinkedPool (1024, p);creates two pools, p and q. Pool q is allocated in storage acquired from p.
 so that instead of allocating memory in the constructor,
	we pass to the constructor
	the address and size of a region to be managed.
	Write a test program and test your implementation.
	so that instead of allocating memory in the constructor,
	we pass to the constructor
	the address and size of a region to be managed.
	Write a test program and test your implementation.
	Modify the simulation shown in Program  as follows:
	In each cycle acquire either four bytes or 32 bytes.
	Use a suitable random number generator (see Section
 as follows:
	In each cycle acquire either four bytes or 32 bytes.
	Use a suitable random number generator (see Section  )
	so that the smaller block is acquired 75% of the time.
)
	so that the smaller block is acquired 75% of the time.
In addition, suppose that the number of cycles that a block is in use is an exponentially distributed random variable. Assume that the smaller blocks are held on average for 10 cycles and that the larger blocks are held on average for 100 cycles.
Use the modified simulation program to compare the various storage pool implementations given in this chapter.
 
  
  
  
  
 
 Copyright © 1997 by Bruno R. Preiss, P.Eng.  All rights reserved.
Copyright © 1997 by Bruno R. Preiss, P.Eng.  All rights reserved.