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

完了済み
投稿日: 約20年前

$30-75 USD

完了時にお支払い
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: 3110394

プロジェクトについて

4個の提案
リモートプロジェクト
アクティブ 20年前

お金を稼ぎたいですか?

Freelancerで入札する利点

予算と期間を設定してください
仕事で報酬を得る
提案をご説明ください
登録して仕事に入札するのは無料です
アワード者:
ユーザーアバター
See private message.
$54.99 USD 8日以内
5.0 (160 レビュー)
6.0
6.0
この仕事に4人のフリーランサーが、平均$49 USDで入札しています
ユーザーアバター
See private message.
$59.50 USD 8日以内
4.9 (62 レビュー)
5.4
5.4
ユーザーアバター
See private message.
$46.75 USD 8日以内
4.9 (25 レビュー)
4.0
4.0
ユーザーアバター
See private message.
$34 USD 8日以内
0.0 (0 レビュー)
0.0
0.0

クライアントについて

UNITED STATESのフラグ
United States
4.9
3
メンバー登録日:2月 4, 2004

クライアント確認

ありがとうございます!無料クレジットを受け取るリンクをメールしました。
メールを送信中に問題が発生しました。もう一度お試しください。
登録ユーザー 投稿された仕事の合計
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
プレビューを読み込み中
位置情報へのアクセスが許可されました。
あなたのログインセッションの有効期限がきれ、ログアウトされました。もう一度ログインしてください。