Spring_2008_Abstract_Data_Structures__ADTs__Stacks_and_Queues

Spring_2008_Abstract_Data_Structures__ADTs__Stacks_and_Queues

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Spring 2008 CS 1316: Representing Structure and Behavior Dawn Finney 1 Abstract Data Types (ADTs): Stacks and Queues Abstract Data Types (ADTs): Stacks and Queues Brief Discussion of Interfaces and Abstract Classes Because abstract date types tend to employ the use of interfaces, it seems beneficial to discuss them before continuing on with abstract data types. Let us consider how many ways there are to solve a particular problem with computer science. Even just consider the different method headers that are available. No normal person has the patience to sift all the different types of methods to figure out how to use them all. Maybe if there were a way to force everyone to use the exact same method headers so that if you know what one method is supposed to do, you know what all of them are supposed to do. You can think of interfaces as a way to do that. Interfaces usually just serve as code templates and are only composed of method headers and empty method bodies (abstract methods). Any class that implements an interface will be forced to override the empty methods. The typical driver is not so interested in how the car works under the hood, but just that it will act like a car. The same can be said of a general user of some class. Some of the skeleton code
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Spring_2008_Abstract_Data_Structures__ADTs__Stacks_and_Queues

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online