Find Jobs
Hire Freelancers

Data Structure in C prog. ..operating systems typically set aside a portion of the computer&'s RAM to cache recently read files. While the amount of RAM is much smaller than size of a disk drive, if many files are accessed repeatedly, a good hit rate can

$30-75 USD

Terminado
Publicado hace alrededor de 20 años

$30-75 USD

Pagado a la entrega
1 Introduction Reading files from disk is a costly operation - usually at least 10ms of time. In constrast, reading data from memory is much cheaper - usually less than a microsecond. Accordingly, operating systems typically set aside a portion of the computer’s RAM to cache recently read files. While the amount of RAM is much smaller than size of a disk drive, if many files are accessed repeatedly, a good hit rate can be achieved. For this project, you will be creating a Cache data type to store the contents of recently read files. 2 The Cache data structure A Cache is a dictionary-like data structure that never keeps more than a certain amount of data. Your Cache will support the following interface: typedef void* Cache; typedef void* DataC; Cache makeCache( int maxTotalCost , void* (*copyDataC )(DataC to, DataC from) , int (*compareDataC )(DataC d1, DataC d2) , void (*freeDataC )(DataC freeMe) ); void freeCache( Cache c ); boolean insertCache( Cache c, DataC d, int cost ); boolean accessCache( Cache c, DataC d ); void setMaxTotalCost( Cache c, int newMaxCost ); int getMaxTotalCost( Cache c ); int getNumItems ( Cache c ); int getTotalCost( Cache c ); Figure 1: Cache.h When a Cache is constructed, it is given a maximum total cost. Each data item that is inserted has a corresponding cost. At any point in time, the sum of the costs of the data items shall never exceed the maximum. If a new item is inserted that would raise the total cost beyond the maximum, the Cache will automatically remove the least recently used (LRU) items, one at a time, until the current total cost is small enough for the new item’s cost to be added. To do this, the Cache will internally keep a sorted list of data items: the least recently used item will be at the tail of the list; the most recently used item will be at the head. Whenever an item is inserted or accessed, it will be moved to the head of this list. That way, items that are not used will eventually wind up at the end of the list..... the complete version of the prog is in the attachment ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement) ## Platform The due date is 2nd of March 2004 The project must be written in C and C programming only. It must be well documented. must include users' manual, programmer logic file and the dot c file. Every detail of the specification should be followed. The operating system or environment the program will run on Unix
ID del proyecto: 3110394

Información sobre el proyecto

4 propuestas
Proyecto remoto
Activo hace 20 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
See private message.
$54,99 USD en 8 días
5,0 (160 comentarios)
6,0
6,0
4 freelancers están ofertando un promedio de $49 USD por este trabajo
Avatar del usuario
See private message.
$59,50 USD en 8 días
4,9 (62 comentarios)
5,4
5,4
Avatar del usuario
See private message.
$46,75 USD en 8 días
4,9 (25 comentarios)
4,0
4,0
Avatar del usuario
See private message.
$34 USD en 8 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
United States
4,9
3
Miembro desde feb 4, 2004

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.