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: Mrs. Maximo Lueilwitz


Marketplace > Oregon State University > ComputerScienence > CS 162 > INTRODUCTION TO COMPUTER SCIENCE II
Mrs. Maximo Lueilwitz
GPA 3.95


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 7 page Class Notes was uploaded by Mrs. Maximo Lueilwitz on Monday October 19, 2015. The Class Notes belongs to CS 162 at Oregon State University taught by Staff in Fall. Since its upload, it has received 9 views. For similar materials see /class/224500/cs-162-oregon-state-university in ComputerScienence at Oregon State University.

Similar to CS 162 at OSU

Popular in ComputerScienence




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/19/15
C8162 Introduction to Computer Science 11 Abstract Data Types Abstract and Concrete Data Types We ve been interested in the concrete implementation of a list ie whether we use a singly or a doubly linked list Now we ll think of a list as an abstract data type Abstract data type de nes the fundamental operations on the data but does not specify an implementation Abstract Data Types 0 An abstract list data type is an ordered sequence of items that can be traversed sequentially and that allows for insertion and removal of elements at any position 0 An abstract array data type is an ordered sequence of items with random access via an integer indeX Specifications for the List ADT 0 Operations on lists Add new entry at end or anywhere Remove an item Remove all items Replace an entry Look at any entry Look for an entry of a specific value Count how many entries Check if list is empty full Display all the entries Specifications for the Array ADT Operations on arrays Get an item at a specific index Set an item at a specific index Get the length of the array ADTs Note that these operations do not depend on the element type Note that we have not specified how the data will be stored or how the operations will be implemented An ADT is an abstraction of the data structure Ordinarily an ADT is described by an interface Java has a List interface but not an Array interface but we can still think of Arrays as an abstract data type Java Class Library The List Interface 0 The standard package contains a list interface called List 0 Methods provided public boolean addObject newEntry public Object removeObject anEntry public void clear public boolean containsObject anEntry public int size like getLength public boolean isEmpty Java Class Library The List Interface 0 Note The functions in the previous slide are the fundamental operations on lists The List interface provides additional methods such as those involving random access although these are done very inefficiently public void addint index Object newEntry public Object removeint index public Object setint index Object anEntry like replace public Object getint index like getEntry Abstract Data Types Array List Pros Pros Fast random access Qlou can No movement of data elements quickly get an element at index 1 Cons Can waste memory if parts of the underlying array are not used Need to resize if you run out of space Need to move elements around if you addremove a specific element during addrem ove No resizing needed Use only as much memory as you need Cons Need to traverse the list to get at a specific element Efficiency of Operations Operation Array List Random Access 01 On Linear Traversal O 1 O 1 Addremove an On 0 1 element How to use abstract data types When programming figure out What operations you need to do on a data structure Then figure out the abstract data type that supports those operations efficiently Without thinking about the implementation details Abstract Data Type Example Suppose you need to keep adding and removing elements to a data structure You know that lists do this very efficiently You then choose the list abstract data type and decide on a concrete implementation eg a doubly linked list A Confusing point 0 An ArrayList tries to combine the behavior of Array and List Abstract Data Types 0 The ArrayList actually implements the List interface even though The addremove methods are done very inefficiently The random access methods are done very efficiently


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

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

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!"

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!"


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

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.