0% found this document useful (0 votes)
34 views

CPCS-204: Data Structures I

This document discusses data structures and their usage in computer science. It defines data structures as particular ways of organizing data to allow for efficient storage, retrieval, and manipulation. Common data structure types include arrays, stacks, linked lists, queues, trees, graphs, hash tables, and heaps. Data structures can be classified based on their existence, memory allocation, and representation. Key operations on data structures include traversing, searching, insertion, deletion, sorting, and merging. The goal of data structures is to organize data in a way that facilitates these important operations.

Uploaded by

hffhf
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)
34 views

CPCS-204: Data Structures I

This document discusses data structures and their usage in computer science. It defines data structures as particular ways of organizing data to allow for efficient storage, retrieval, and manipulation. Common data structure types include arrays, stacks, linked lists, queues, trees, graphs, hash tables, and heaps. Data structures can be classified based on their existence, memory allocation, and representation. Key operations on data structures include traversing, searching, insertion, deletion, sorting, and merging. The goal of data structures is to organize data in a way that facilitates these important operations.

Uploaded by

hffhf
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/ 11

‫بسم هللا الرحمن الرحيم‬

King Abdulaziz University


Faculty of Computing and information Technology
Computer Science Department

CPCS-204 Data Structures I


2- Data

CPCS204, Data Structures I, Updated by Pr. Abdullah Basuhail, CS, FCIT, KAU, 1442H-2021G 1
Data
• Collection of facts from which conclusion may be drawn
• Example:
• Temperature is 10o C;
• Conclusion: COLD!

• Types of data:
• Textual: name (Muhammad)
• Numeric: id (375604)
• Audio: voice
• Image: picture
• …
CPCS204, Data Structures I, Updated by Pr. Abdullah Basuhail, CS, FCIT, KAU, 1442H-2021G 2
Data Types
• Built-in constructs of a programming language to manipulate
“basic types of data”
• Character
• Integer
• Real
• …
• Examples
• int, char, double, …

CPCS204, Data Structures I, Updated by Pr. Abdullah Basuhail, CS, FCIT, KAU, 1442H-2021G 3
Data Structures
• A particular way of storing and organizing data in a computer
so that it can be used efficiently
• Group of data elements grouped under one name
• Also referred as Abstract Data Type (ADT)
• Example:
• Array:
int dayTemperatures[24];

CPCS204, Data Structures I, Updated by Pr. Abdullah Basuhail, CS, FCIT, KAU, 1442H-2021G 4
Goal
• Organize data to facilitate efficient
• Storage
• Retrieval
• Manipulation

• Design Issue
• Challenge is to select most appropriate DS for a problem

CPCS204, Data Structures I, Updated by Pr. Abdullah Basuhail, CS, FCIT, KAU, 1442H-2021G 5
Data Structures Types
• Array
• Stack
• Linked list
• Queue
• Tree
• Graph
• Hash Table
• Heap
CPCS204, Data Structures I, Updated by Pr. Abdullah Basuhail, CS, FCIT, KAU, 1442H-2021G 6
Data Structures Classification
• Based on Existence
• Physical
• Can be created independently
– Array, Linked List

• Logical
• Can’t be created independently
– Stack, queue, tree, graph

CPCS204, Data Structures I, Updated by Pr. Abdullah Basuhail, CS, FCIT, KAU, 1442H-2021G 7
Data Structures Classification
• Based on Memory allocation
• Static
• Fixed sized DSs
– Arrays

• Dynamic:
• Change size
– Linked lists

CPCS204, Data Structures I, Updated by Pr. Abdullah Basuhail, CS, FCIT, KAU, 1442H-2021G 8
Data Structures Classification
• Based on Representation
• Linear
• Arrays
• Linked lists
• Stack
• Queues

• Non-linear
• Trees
• Graphs

CPCS204, Data Structures I, Updated by Pr. Abdullah Basuhail, CS, FCIT, KAU, 1442H-2021G 9
Operations on Data Structures
• Traversing
• Accessing/visiting each data element exactly once so that certain
items in the data may be processed

• Searching
• Finding location of a given data element (key) in the structure

• Insertion
• Adding new data element to structure

CPCS204, Data Structures I, Updated by Pr. Abdullah Basuhail, CS, FCIT, KAU, 1442H-2021G 10
Operations on Data Structures
• Deletion
• Removing a data element from structure

• Sorting
• Arranging the data elements in some logical fashion
• ↑↓

• Merging
• Combining data elements form two or more data structures into one

CPCS204, Data Structures I, Updated by Pr. Abdullah Basuhail, CS, FCIT, KAU, 1442H-2021G 11

You might also like