fa10-sl-e3 - ECE 3035 4 problems 5 pages Computing Mechanisms Exam Three Fall 2010 1 December 2010 Instructions This is a closed book closed note exam

# fa10-sl-e3 - ECE 3035 4 problems 5 pages Computing...

This preview shows page 1 - 4 out of 5 pages.

ECE 3035 Computing Mechanisms Fall 2010 4 problems, 5 pages Exam Three 1 December 2010 Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate the pages of the exam. For maximum credit, show your work. Good Luck! Your Name ( please print ) ________________________________________________ 1 2 3 4 26 24 26 24 100 1
ECE 3035 Computing Mechanisms Fall 2010 4 problems, 5 pages Exam Three 1 December 2010 Problem 1 (3 parts, 26 points) Hash Tables Consider an open hash table composed of a four-bucket table, with each bucket containing a variable length list. Each list entry has three slots <key, value, next> corresponding to the three word groupings in the entries section. The hash function is key mod four . Inserted entries are appended to the end of a bucket list. Deallocated entries are maintained on a LIFO free list. When the free list is empty, new entry objects are allocated from heap memory. Accesses are listed as <op, key, [value]>. Simulate the access list below and draw the ending state. Assume the heap pointer is initially 5040 and the free pointer is initially 0. Heap Pointer 5040 Free List 0000 Buckets 5000 5004 5016 5008 5012 5028 Entries 5016 21 5040 5064 5088 5020 222 5044 5068 5092 5024 0 5048 5072 5096 5028 83 5052 5076 5100 5032 333 5056 5080 5104 5036 0 5060 5084 5108 Hash Table Access Trace # op key value # op key value 1 insert 43 444 5 insert 89 333 2 remove 83 n/a 6 remove 43 n/a 3 insert 21 777 7 insert 88 555 4 insert 69 888 8 insert 22 666 2
ECE 3035 Computing Mechanisms Fall 2010 4 problems, 5 pages Exam Three 1 December 2010 Problem 2 (3 parts, 24 points) Short Answer Part A (10 points) Consider a hash table that uses 15 buckets , each containing an unsorted LIFO list of items. Suppose the hash table contains 600 entries total and the entries are evenly distributed across the hash table buckets. Assume that

#### You've reached the end of your free preview.

Want to read all 5 pages?

• Fall '08
• Staff

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern