DATA STRUCTURES, ANALYSIS OF ALGORITHMS AND COMPUTATIONAL COMPLEXITY
a) Describe in words and diagrams (with example data) the two different implementations. Discuss each one in general but also be sure to describe how each one handles collisions.
b) For each of the two implementations, state in BIG-THETA (Q) terms the average case and the worst-case performance for the find operation.
COMPUTER ARCHITECTURE AND OPERATING SYSTEMS
a) Briefly explain the term "page fault".
b) Briefly explain the term "page replacement policy"
c) Briefly explain how the LRU policy works.
d) In demand paged memory management that uses LRU, a process makes the following sequence of page references:
1 3 4 2 1 1 2 3 4 3 5 1 4 6 1 4 3
Calculate the number of page faults, assuming that only 3 page frames are available to the process. Assume that no pages are initially loaded. Show your work.
PROGRAMMING LANGUAGES AND COMPILER DESIGN
void f() {
int a[n];
int b[m];
...}
a) The language X should have a rule for when the values for n and m must be bound to actual values. List all possibilities for this binding time.
b) Suppose that X allows assignment on arrays, as in a := b. It must have a rule that states when arrays are assignment compatible. List the possible rules that X could use and briefly explain each.
int a = 32;
int f(int x){
return(x*a);
}
int g( int h(int); int z){ return h(z);}
int main(void){
int a = 64, b = 10;
a = g(f, b);
print(a);
}
a) Display the runtime stack when it is at its highest point. Include all important information.
b) What does this program print? Explain.
a = a+b+c*d*(a+b)
b = a+b+c*d
b) Write the DAG (directed acyclic graph) that corresponds to the intermediate code in a).