New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here


by: Mr. Hayley Barton


Mr. Hayley Barton

GPA 3.93


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 4 page Class Notes was uploaded by Mr. Hayley Barton on Thursday October 22, 2015. The Class Notes belongs to COMPSCI 061BL at University of California - Berkeley taught by Staff in Fall. Since its upload, it has received 54 views. For similar materials see /class/226663/compsci-061bl-university-of-california-berkeley in ComputerScienence at University of California - Berkeley.




Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/22/15
39 Agenda Static vs Dynamic Box and pointer diagrams Code Questions and examples Bit representation Algorithmic Analysis Access rights Quickie questions 5 CS618 Midterm Review Winston Liaw and Amir Kamil w A m a u Miamiquot Review 2 Static vs Dynamic 39 Static vs Dynamic cont What happens Assume we have What happens Assume the same de ned definitions Homer h new Homer Bart b new BartO Bart bl b b1talk2 Homer h1 b Answer Homer Bart dude h1talk2 rtoon c1 h Answer Homer Bart dude Homerc1mk4 Answer Homer Homer doh m 3 Mew WW 4 Static vs Dynamic cont l Static vs Dynamic cont What happens For calls with an object of interest ie hf static methods are called based Cartoon 2 b on static type nonstatic methods are Bartc2whoa based on dynamic type Answer dude For calls involving this things get a Lumpy I2 b little trickier Static calls stay in the Homenml lmo same class dynamIc calls are based on the dynamIc set Answer Bart dude m 5 Mew WW 5 Box and Pointer diagrams Draw the diagrams that result from this code int x new int3 int y new int0 int z new int32 Midterm Review 7 39 Box and Pointer diagrams Draw the diagrarns that result trorn this code int 1 x new int3 int 1 v new into int 1 z new int32 z llllll x mm vEl l a a nu Midterm Review a Box and Pointer diagrams cont Modify the box and pointer diagram according to this code 2D Z2 Midterm Review 9 Box and Pointer diagrams l cont Moditv the box and pointer diagrarn according to this code Z1Z2r z I ll n an an Midterm Review in Coding Question Finish this method Given an IntList it will reverse it destructively and return the new list public IntList reverseIntList I Midterm Review 11 Coding Question Solution inttist ht public inttist reverse uilr i lritLiSt next l all white i i nuii next Halli itaii prev prev ii i next i return prev Hence we are done reversing an the pointers iwe need to set i s head to the new head Midterm Review 12 Bit Representation What is the bit representation for byte b 15 Answer 00001111 What is this value as a char 10110111 Answer 183 What about as a byte Answer 73 Midterm Review g Bit Representation Two s complement If the Most Significant Bit MSB is 0 then treat the remaining bits as normal as a positive number If the MSB is 1 flip the remaining bits add 1 and that is your negative value Remember two s complement only applies to signed values For an unsigned integer for instance treat it as normal Midterm Review g Modular Arithmetic For modular arithmetic Find out how many times your divisor can divide into your dividend Remember the remainder must be positive If the remainder is greater than the range of your values byte can have values btw 128 and 127 for instance then loop value around Midterm Review g Another Coding Question Finish these methods IntList pqueue removes the node with smallest value public int remove inserE the value into pqueue public void insertint m Midterm Review Another Coding Question Solution public int remove int X pqueuehead pqueue pqueuetai return X Midterm Review Another Coding Question I Solution cont public void inseam m 1 in eew ev tail new IntListllt temp elsel pqueue newnttis1llt pqueue prev emp temp e temp tail Midterm Review Algorithmic Analysis Definition of Big0h Ogn fn there exist positive constants c and no such that 0 lt fn lt cgn for all n gt no Definition of BigOmega Qgn fn there exist positive constants c and no such that 0 lt cgn lt fn for all n gt no Miamiquot Review 19 g Algorithmic Analysis One method takes Onz while another takes On gn The On gn method is always preferred True or false Miamiquot Review 2n go Algorithmic Analysis What are the running times BigOh Big Omega BigTheta for this code for int i k i lt 2 i for intj 0 lt zj some lg n code here Answer all are zkzlgn i term Review 21 Access rights If you override a method in a child class Java allows you to change the access rights to be less restrictive EX Parent s method is protected Child s method is public Refs to page 113 ll i Programmng ii ito Java for more details Miamiquot Review 22 Quickies What class has no superclass Why would you want to pick an array over a list Miamiquot Review 23


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Janice Dongeun University of Washington

"I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.