



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
Main points of this exam paper are: Breadth-First Search, Graph Adjacency, Binary Heap, Throws Exception, Leaf Nodes, Search Tree, Game Search, Beta Pruning, Breadth-First Search, Depth-First Search
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!
University of California at Berkeley Department of Electrical Engineering and Computer Sciences Computer Science Division
Spring 2009 Jonathan Shewchuk
This is an open book, open notes exam. Electronic devices are forbidden on your person, including cell phones, iPods, headphones, laptops, and PDAs. Turn your cell phone off and leave it and all electronics at the front of the room, or risk getting a zero on the exam. Do not open your exam until you are told to do so!
Name:
Login:
Lab TA:
Lab day and time:
Do not write in these boxes. Problem # Possible Score
Total 25
Problem 1. (12 points) A Miscellany.
a. (3 points) Draw the following binary heap after removeMin(), then again after insert(2).
b. (1 point) Each of the exceptions XException, YException, ZException, BException, CException, DException, and EException is declared so it “extends Exception”. Which exception, if any, propagates out of the following code?.
public static void z() throws Exception { try { throw new XException(); } catch (YException y) { throw new ZException(); } catch (Throwable t) { try { throw new BException(); } catch (RunTimeException c) { throw new CException(); } throw new DException(); } catch (BException b) { throw new EException(); } }
c. (3 points) The leaf nodes of the following game search tree are scored as indicated. Cross out all the nodes that will be pruned (i.e. not visited) if alpha-beta pruning is used. Assume children are explored from left to right.