A cache of size S with CL as the number of cache lines and block size B is to be built. S, CL, and B are in powers of 2. Write a program that allows loading into cache and searching cache using:
1. Direct mapping
2. Associative memory
3. n-way set associative memory where n is a power of 2.
Using java language