0% found this document useful (0 votes)
10 views23 pages

CH 12 Data Structures

The document is a course outline for 'Introduction to Computer Engineering' focusing on data structures and algorithms. It covers key concepts such as Abstract Data Types, algorithm strategies, various data structures, and searching and sorting techniques. The course aims to provide students with a foundational understanding of how data is organized and manipulated in computer systems.

Uploaded by

mdursun5040
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views23 pages

CH 12 Data Structures

The document is a course outline for 'Introduction to Computer Engineering' focusing on data structures and algorithms. It covers key concepts such as Abstract Data Types, algorithm strategies, various data structures, and searching and sorting techniques. The course aims to provide students with a foundational understanding of how data is organized and manipulated in computer systems.

Uploaded by

mdursun5040
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Introduction to

Computer Engineering
CEN 123, Fall 2024-2025
Assoc. Prof. Dr. Mümine KAYA KELEŞ
Department of Computer Engineering
Adana Alparslan Türkeş Science and Technology University
CHAPTER 12
DATA STRUCTURES AND
DATA MODELS
COURSE OUTLINE

1. The Abstract Data Type


2. What is Algorithms?
3. Algorithm Strategies
4. What is Data Structure?
5. Common Data Structures
The Abstract Data Type

An ADT consists of a data declaration packaged together with the


operations that are meaningful on the data while embodying the
structured principles of encapsulation and data hiding.
The basic parts of an ADT:

• Atomic and Composite Data


• Data Type
• Data Structure
• Abstract Data Type

4
What is Algorithm?

 Algorithm:
 A computable set of steps to achieve a desired result
 A well-defined procedure that allows a computer to solve
a problem.
 Ralationship to Data Structure
 Example: Find an element

2 4 6

1 3 5 7

1 2 3 4 5 6 7
Algorithms vs. Data Structures
Algorithms vs. Data Structures

From the data structure point of view, the following are some
important categories of algorithms:

Data Structures are the


programmatic way of storing data
so that data can be used efficiently.

Algorithms in most cases need


data structures internally to make
them work as intended.
How many Algorithms?
 Countless
Algorithm Strategies

A strategy is an approach (or a series of approaches)


devised to solve a computational problem.

 Greedy
 Divide and Conquer
 Dynamic Programming
 Exhaustive Search
Which Data Structure or
Algorithm is better?
 Must Meet Requirement
 High Performance
 Low RAM footprint
 Easy to implement
 Encapsulated
What is Data Structures?

 What is Data Structures?


 A data structure is defined by
 (1) the logical arrangement of data elements, combined
with
 (2) the set of operations we need to access the elements.
Data Structures
Aggregation of atomic and composite data into a set with defined
relationships. Structure refers to a set of rules that hold the data
together.
• A combination of elements in which each is either a data type or another
data structure.
• A set of associations of relationship involving combined elements.
Example:

12
13
Atomic Variables

 Atomic variables can only store one value at a time.


int num;
float s;
 A value stored in an atomic variable cannot be
subdivided.
Functions of Data Structures

 Add
 Index
 Key
 Position
 Priority
 Get
 Change
 Delete
What is Data Structures?

 Example:library
 is composed of elements (books)
 Accessing a particular book requires
knowledge of the arrangement of the
books
 Users access books only through the
librarian

the logical arrangement of data elements,


combined with the set of operations we need
to access the elements.
Basic Data Structures

 Structures include
 linked lists
 Stack, Queue
 binary trees
 …and others
Common Data Structures

 Array
 Stack
 Queue
 Linked List
 Tree
 Heap
 Hash Table
 Priority Queue
Common Data Structures -
Introduction
 Dynamic data structures
 Data structures that grow and shrink during execution
 Linked lists
 Allow insertions and removals anywhere
 Stacks
 Allow insertions and removals only at top of stack
 Queues
 Allow insertions at the back and removals from the front
 Binary trees
 High-speed searching and sorting of data and efficient
elimination of duplicate data items
SEARCHING TECHNIQUES

1. LINEAR (SEQUENTIAL) SEARCH


2.BINARY SEARCH
SEARCHING TECHNIQUES

 To finding out whether a particular element is present


in the list.
 2 methods: linear search, binary search
 The method we use depends on how the elements of
the list are organized
 unordered list:
 linear search: simple, slow
 an ordered list
 binary search or linear search: complex, faster
SORTING TECHNIQUES

We need to do sorting for the following reasons :

a) By keeping a data file sorted, we can do


binary search on it.
b) Doing certain operations, like matching data in
two different files, become much faster.

There are various methods for sorting: Bubble


sort, Insertion sort, Selection sort, Quick sort,
Heap sort, Merge sort…. They having different
average and worst case behaviours.
SORTING TECHNIQUES

1. BUBBLE SORT
2. INSERTION SORT
3. SELECTION SORT
4. QUICK SORT

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy