ICIS Practicum Laboratory
1.0 INTRODUCTION
In any programming language, there are several data types that are available for programmers to use, such as integers, floating point numbers, strings or characters. Many applications need more complicated structures of data that can be added on a program-to-program basis; hence, the notion of data abstraction.
An abstract data types (ADT) consists of data together with functions that operate on the data. We also can say that it’s a set of data values and associated operations that are precisely specified independent of any particular implementation. An abstract data types is “abstract” in the sense that how data are represented and how functions are implemented are not specified. Only the behavior of the functions is specified. Examples of ADTs include that of Stack, Queue and Links.
In this lab, we are going to implement some of familiar ADTs like stack and queue using Visual C++ programming language. In this experiment we were more focus on the data structures in stead of programming language skills.
2.0 OBJECTIVES
The objectives of the experiment are: a) Understand on the design and implementation of abstract data types. b) Able to implement ADTs using appropriate data structures. c) Able to process and manipulate data elements associated with ADTs.
3.0 THEORETICAL BACKGROUND 3.1 The stack abstract data type
The stack is ubiquitous. It is a temporary abstract data type and data structure based on the principle of Last in First out (LIFO).A stack is a list of items with the restriction that insertion and deletion can only be performed in only one position, namely the end of the list called the “top”. The fundamental operations of the stack are “push”, which is equivalent to insert, add -1-
Experiment L215
ICIS Practicum Laboratory
the item at the top of the stack and “pop” operation which removes the most recently added item. Shown as Figure 2.1 Stacks are sometimes known
References: RICHARD JOHNSONBAUGH and MARCUS SCHAEFER, ALGORITHMS, Prentice Hall, 2004 - 17 -