0
Upcoming SlideShare
×

# MELJUN CORTES Jedi slides data st-chapter01-basic concepts and notations

462

Published on

MELJUN CORTES Jedi slides data st-chapter01-basic concepts and notations

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
462
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
32
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Transcript of "MELJUN CORTES Jedi slides data st-chapter01-basic concepts and notations"

1. 1. 1 Basic Concepts and Notations Data Structures – Basic Concepts and Notations 1
2. 2. ObjectivesAt the end of the lesson, the student should be able to:● Explain the process of problem solving● Define data type, abstract data type and data structure● Identify the properties of an algorithm● Differentiate the two addressing methods - computed addressing and link addressing● Use the basic mathematical functions to analyze algorithms● Measure complexity of algorithms by expressing the efficiency in terms of time complexity and big-O notation Data Structures – Basic Concepts and Notations 2
3. 3. Problem Solving Process● Programming – a problem-solving process which could be viewed in terms of the following domains: – Problem domain ● input or the raw data to process ● output or the processed data – Machine domain ● storage medium - consists of serially arranged bits that are addressable as a unit ● processing unit - allow us to perform basic operations – Solution domain - links the problem and machine domains Data Structures – Basic Concepts and Notations 3
4. 4. Problem Solving Process Problem Domain Data Structures – Basic Concepts and Notations 4
5. 5. Problem Solving Process Machine Domain Data Structures – Basic Concepts and Notations 5
6. 6. Problem Solving Process Solution Domain Data Structures – Basic Concepts and Notations 6
7. 7. Problem Solving Process● Two related tasks at the solution domain – Structuring of higher level data representations – Synthesis of algorithms● Data structures and algorithms are the building blocks of computer programs Data Structures – Basic Concepts and Notations 7
8. 8. Data Type, Abstract Data Type and Data Structure● Data type - kind of data that variables can assume in a programming language and for which operations are automatically provided● Abstract Data Type (ADT) - mathematical model with defined operations. In Java, an ADT can be expressed with an interface Data Structures – Basic Concepts and Notations 8
9. 9. Data Type, Abstract Data Type and Data Structure public interface Stack{ public int size(); /* returns the size of the stack */ public boolean isEmpty(); /* checks if empty */ public Object top() throws StackException; public Object pop() throws StackException; public void push(Object item) throws StackException; }● Data structure – the implementation of ADT in terms of the data types or other data structures.In Java, a data structure can be expressed with a class Data Structures – Basic Concepts and Notations 9
10. 10. Algorithm● Finite set of instructions which, if followed, will accomplish a task – Finiteness - an algorithm must terminate after a finite number of steps – Definiteness - ensured if every step of an algorithm is precisely defined – Input - domain of the algorithm which could be zero or more quantities – Output - set of one or more resulting quantities; also called the range of the algorithm – Effectiveness - ensured if all the operations in the algorithm are sufficiently basic that they can, in principle, be done exactly and in finite time by a person using paper and pen Data Structures – Basic Concepts and Notations 10
11. 11. Addressing Methods● Computed Addressing Method - used to access the elements of a structure in pre-allocated space int x[10][20]; a = x[4][3];● Link Addressing Method – used to manipulate dynamic structures where the size and shape are not known beforehand or changes at runtime class Node{ Object info; Node link; Node() { } Node (Object o, Node l){ info = o; link = l; } } Data Structures – Basic Concepts and Notations 11
12. 12. Addressing Methods– Memory pool or avail list - source of the nodes from which linked structures are built class AvailList { Node head; AvailList(){ head = null; } AvailList(Node n){ head = n; } } Data Structures – Basic Concepts and Notations 12