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

Concluído
Publicado há aproximadamente 20 anos

$30-75 USD

Pago na 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 do Projeto: 3110394

Sobre o projeto

4 propostas
Projeto remoto
Ativo há 20 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
See private message.
$54,99 USD em 8 dias
5,0 (160 avaliações)
6,0
6,0
4 freelancers estão ofertando em média $49 USD for esse trabalho
Avatar do Usuário
See private message.
$59,50 USD em 8 dias
4,9 (62 avaliações)
5,4
5,4
Avatar do Usuário
See private message.
$46,75 USD em 8 dias
4,9 (25 avaliações)
4,0
4,0
Avatar do Usuário
See private message.
$34 USD em 8 dias
0,0 (0 avaliações)
0,0
0,0

Sobre o cliente

Bandeira do(a) UNITED STATES
United States
4,9
3
Membro desde fev. 4, 2004

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos 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)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.