

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Subject : CS351 , Final exam practice.
Typology: Exercises
1 / 3
This page cannot be seen from the preview
Don't miss anything!
struct Score{ int x, y; }; struct Score points[100]; int sum = 0; for (int i = 0; i < 100; i++){ sum += points[i].x + points[i].y; } The code in the above loop is an example of: A) Good temporal locality B) Good spatial locality C) Both good spatial and good temporal locality D) None of the above MCQ 2: int arr[50]; char *ap=(char )arr; Which of the following accesses the same value as arr[20]? A) ((int)(ap+20sizeof(int))) B) *((char *)(ap+20)) C) *((int *)(ap+20)) D) *((char )(ap+20sizeof(int)))
True or False: In an implicit free list allocator, each free block contains pointers to the next and previous free blocks. Inserting freed blocks so that free list blocks are always in address order requires linear time. Internal fragmentation occurs when free memory is divided into small, noncontiguous chunks, preventing the allocation of large blocks despite there being enough total free space. In an explicit free list, boundary tags are typically not needed for coalescing.