Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 9, Problem 9.15HW
Determine the block sizes and header values that would result from the following sequence of malloc requests. Assumptions: (1) The allocator maintains double-word alignment and uses an implicit free list with the block format from Figure 9.35. (2) Block sizes are rounded up to the nearest multiple of 8 bytes.
Request | Block size (decimal bytes) | Block header (hex) |
malloc(3) | ______ | ______ |
malloc(11) | ______ | ______ |
malloc(20) | ______ | ______ |
malloc(21) | ______ | ______ |
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Memory Allocation (20 minutes)
Assume you have a buddy allocator that initially has a single 512 byte free block. You cannot allocate more memory.
The first allocation is for 200 bytes. Describe how the allocation occurs with the buddy algorithm. State what's in the free list after the allocation.
How many bytes are lost to internal fragmentation after this first allocation?
Next, we deallocate the 200 byte allocation. Describe what happens. State what the free list looks like now.
Now, we get 4 different 100 byte allocations. You don't have to describe the process. However, state the free list at the end of all 4 allocations.
How many bytes are lost due to internal fragmentation after the 4 allocations?
Describe an approach you could take to fit another 100 byte allocation within your original 512 bytes. You can assume you can use your approach to allocate all 5 100 byte allocations
from scratch.
Part Two: Implementing a rainbow table
You are to write a program, in C/C++, Java or Python, that should run using the following instruction:
$ ./Rainbow Passwords.txt
where the file Passwords.txt contains a list of possible passwords. The password file contains a password
per line, as in the provided words file and consists of strings of printable characters. Any password used
must be taken from this file, so the only stored hash information needs to relate to those entries in the file.
The program is used to find pre-images for given hash values. Rainbow tables can be used to solve
pre-image problems for hash functions. At the simplest level they can simply be a list of hash values
and the corresponding pre-images, often from some dictionary. This can be expensive in terms of storage
space however, and a more efficient way of identifying pre-images involves the use of the hash function
and reduction functions.
First step
The process is as follows:
1. Read in the list of possible…
Data Structures and Algorithm (Only using C/C++)
Note: Write it using Structures
Q. Write down a simple code for stroing studnet data in a link list.You must be able to search the record of a particular student and display it on demand.the following information must be stored. 1. student full id e.g sp17-bcs-0092. student name3. student current semester4. student CGPA
Chapter 9 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 9.2 - Prob. 9.1PPCh. 9.3 - Prob. 9.2PPCh. 9.6 - Prob. 9.3PPCh. 9.6 - Prob. 9.4PPCh. 9.8 - Practice Problem 9.5 (solution page 882) Write a C...Ch. 9.9 - Prob. 9.6PPCh. 9.9 - Prob. 9.7PPCh. 9.9 - Prob. 9.8PPCh. 9.9 - Prob. 9.9PPCh. 9.9 - Prob. 9.10PP
Ch. 9 - Prob. 9.11HWCh. 9 - Repeat Problem 9.11 for the following address....Ch. 9 - Repeat Problem 9.11 for the following address....Ch. 9 - Given an input file hello.txt that consists of the...Ch. 9 - Determine the block sizes and header values that...Ch. 9 - Prob. 9.16HWCh. 9 - Prob. 9.17HWCh. 9 - Prob. 9.18HWCh. 9 - Prob. 9.19HWCh. 9 - Write your own version of malloc and free, and...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
It is considered good programming practice to store the declaration for a class, its function definitions, and ...
Starting Out with C++: Early Objects (9th Edition)
Determine the resultant force and specify where it acts on the beam measured from A.
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
This optional Google account security feature sends you a message with a code that you must enter, in addition ...
SURVEY OF OPERATING SYSTEMS
The cylinder CD of the assembly is heated from T1 = 30C to T2 = 180C using electrical resistance. At the lower ...
Mechanics of Materials (10th Edition)
You use a(n) __ statement in pseudocode to write a single alternative decision structure. a. Test -Jump b. If-T...
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Write a statement that defines a file stream object named places. The object will be used for both output and i...
Starting Out with C++ from Control Structures to Objects (9th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- How is an array stored in main memory? How is a linked list stored in main memory? What are their comparative advantages and disadvantages? Give examples of data that would be best stored as an array and as a linked list.arrow_forwardPlease convert the code to C Language #include <bits/stdc++.h>using namespace std; //comparing goodness of hash function 1 & 2int main(){ //set of input numbers vector<int> arr{ 12345, 234245, 1223123, 765845, 345234, 234534, 98675, 34523, 123, 3245 }; //using hash function 1 cout << "using hash function 1\n"; for (int a : arr) { cout << a << "->" << to_string(a).length() % 10 << endl; } //using hash function 2 cout << "\n\nusing hashh function 2\n"; for (int a : arr) { cout << a << "->" << (rand() * a) % 10 << endl; } return 0;} Output:arrow_forward4. Write a program to implement the address book using dynamic singly linked list, the node should contain name, address and phone#: (1) Write a function create to store three people's information into the singly linked list; (2) Write a function print to print these information to the standard output; (3) Write a function search to find the telephone number of a contact input by name. CA "C:\Documents and Settings\Administrator á Lab\2\Debug\final.2.exe" ******************* Input ******************* Input name: Zhang San Input address: XUPT Input phone: 123456 Input name: Li Si Input address: XJTU Input phone: 789012 Input name: Wang Wu Input address: Clemson Input phone: 345678 ******************* andano ******************** Name: Zhang San Address: XUPT Phone: 123456 Name : Li Si Address: XJTU Phone: 789012 Name: Wang Wu Address: Clemson Phone: 345678 Please input the name to search: Li Si Contact Li Si: phone number is 789012 Press any key to continue.arrow_forward
- Use C++ Programming Language. Objective Define a circular buffer data structure and test it. Problem Description: A circular buffer (also called a circular queue) is circular list of nodes where data items are added on one end of the buffer and removed from the other end. Because the nodes form a circular list, the list has no end or beginning: the tail node points to the head node, creating a ring of nodes. You may think of the nodes as containers or slots that are all initially empty but can be assigned a value in their data field info. Every time a new data item is inserted (inserting to a buffer is often referred as Writing), one slot is filled and the buffer has one less empty slot. Every time a data item is removed (referred to as Reading), the buffer has one more empty slot. Since the list has no beginning and no end, a pointer (writeIndex) is used to mark the next empty slot to write to and a second pointer (readIndex) is used to mark the next node to read from. The…arrow_forwardObjective Define a circular buffer data structure and test it. Problem Description: A circular buffer (also called a circular queue) is circular list of nodes where data items are added on one end of the buffer and removed from the other end. Because the nodes form a circular list, the list has no end or beginning: the tail node points to the head node, creating a ring of nodes. You may think of the nodes as containers or slots that are all initially empty but can be assigned a value in their data field info. Every time a new data item is inserted (inserting to a buffer is often referred as Writing), one slot is filled and the buffer has one less empty slot. Every time a data item is removed (referred to as Reading), the buffer has one more empty slot. Since the list has no beginning and no end, a pointer (writeIndex) is used to mark the next empty slot to write to and a second pointer (readIndex) is used to mark the next node to read from. The readIndex/writeIndex must be…arrow_forwardO The core implementation of a contiguous list is 1D array of same or different data types. O O Which of the following statements are false? select all that apply O The stack is not similar to list in terms of flexibility Stack is based on FIFO concept, however, Queue is based on LIFO concept Stack can be accessed by one end Time left Queue are amongst the most important data structure because they are used when various users attempting to access the system at the same time.arrow_forward
- Problem 3: Almost a priority queue. Design a data structure that supports the followingoperations for almost a priority queue:(i) FindSecondSmallest() which returns the second smallest item in the data structure.(ii) Insert(x) which inserts item x to the data structure.(iii) DeleteSecondSmallest() which removes the second smallest item from the datastructure.Your data structure should implement the operation FindSecondSmallest() in O(1), andthe other two operations in O(log n), where n is the number of elements in the datastructure.arrow_forward#define index OXC2 #define count OXC5 MOVLW .5 CLRF index CLRF count floop: INCF index,1,1 ADDWF count,1,0 CPFSEQ index,1 BRA floop After the above code has been executed, match index and count with correct values from the drop down list. index [ Choose ] [ Choose ] count 25 Carry Status bit 255 >arrow_forwardScala programmingarrow_forward
- API Windows. Using of memory. In the C language, in terms of the Windows API, develop a program that dynamically allocates two data structures in different heaps (one in the default heap, the other in an additionally allocated heap). Request the expected volumes of structures from the user from the keyboard. Choose the type and method of filling structures at your discretion. Provide for the release of all allocated resources before the end of the program.arrow_forward(d) create_area_dict(list2D) that takes a 2D-list containing the database as input and creates a dictionary called area_dict (you may rename it), where keys are the identity number of a CMA (ID) and values are the name of the CMA (Area). This function must return the dictionary. See sample output below. area_dict = create_area_dict(database) display_dict(area_dict) 31 - Cityview - Crestview - Meadowlands 903 - Billings Bridge - Alta Vista 908 - Byward Market 912 Carson Grove Carson Meadows 923 Glebe - Dows Lake 940 Overbrook - McArthur 942 - Portobello South 949 - Sandy Hill 957 - West Centertown (e) create_crime_dict(filename) that takes the filename of a csv file as input and returns a dictionary called crime_dict (you may rename it). This function reads the header of the csv file and stores data in crime_dict such that keys are the indices of a crime type on the header row, and values are the corresponding crime types (names are case sensitive). You can assume that indices start…arrow_forwardKindly complete the tablearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Instruction Format (With reference to address); Author: ChiragBhalodia;https://www.youtube.com/watch?v=lNdy8HREvgo;License: Standard YouTube License, CC-BY