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

Topic 1 Notes

The document provides an overview of data structures and algorithms, emphasizing their importance in computer applications for efficient data organization and retrieval. It defines key concepts such as data, data types, data structures, and abstract data types, while categorizing data structures into linear, hash tables, and non-linear types. The selection of appropriate data structures is crucial for algorithm efficiency and implementation quality.

Uploaded by

antomotongori
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)
6 views

Topic 1 Notes

The document provides an overview of data structures and algorithms, emphasizing their importance in computer applications for efficient data organization and retrieval. It defines key concepts such as data, data types, data structures, and abstract data types, while categorizing data structures into linear, hash tables, and non-linear types. The selection of appropriate data structures is crucial for algorithm efficiency and implementation quality.

Uploaded by

antomotongori
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/ 3

Topic 1 Notes

1.1 Introduction
Data structures and Algorithms are at the heart of every computer application. Therefore every
computer scientist and every professional programmer should know about the basic structures that
allow efficient organization and retrieval of data, frequently used algorithms, and generic
techniques for modeling, understanding, and solving algorithmic problems.
The information that is available to the computer consists of a selected set of data about the actual
problem, namely that set that is considered relevant to the problem at hand, that set from which it
is believed that the desired results can be derived. The data represent an abstraction of reality in
the sense that certain properties and characteristics of the real objects are ignored because they are
peripheral and irrelevant to the particular problem.
In solving a problem with a computer it is necessary to choose an abstraction of reality, i.e., to
define a set of data that is to represent the real situation. This choice must be guided by the problem
to be solved. Then follows a choice of representation of this information. This choice is guided by
the tool that is to solve the problem, i.e., by the facilities offered by the computer.

Definitions
Data
Data can be represented in the form of binary digits in memory using the basic unit of data called
bit which can represent either a zero or a one.

Data type
A data type defines the specification of a set of data and the characteristics for that data. It is
derived from the basic nature of data that are stored for processing.

Data Structure
Data structure refers to the actual implementation of the data type and offers a way of storing data
in an efficient manner. A data structure is designed to organize data to suit a specific purpose so
that it can be accessed and worked in appropriate ways both effectively and efficiently. It may be
selected or designed to store data for the purpose of working on it by various algorithms.

The choice of a data structure begins from the choice of an abstract data type. Data structures are
implemented using the data types, references and operations on them that are provided by a
programming language.

Example data structures include:


Arrays
Stacks
Queues
Linked Lists

Abstract Data Types (ADT)


An Abstract Data Type (ADT) defines data together with the operations. ADT is specified
independently of any particular implementation. ADT depicts the basic nature or concept of the
data structure rather than the implementation details of the data.
1.2 Types of Data Structures
Types of data structures include linear data structures, hash tables and non linear data structures.
Linear structures
A data structure is said to be linear if its elements form a sequence or a linear list.
Some of the linear structures are:
Array: Fixed-size
Linked-list: Variable-size
Stack: Add to top and remove from top
Queue: Add to back and remove from front
Priority queue: Add anywhere, remove the highest priority Possible

Operations on these linear structures include:


Traversal: Travel through the data structure
Search: Traversal through the data structure for a given element
Insertion: Adding new elements to the data structure
Deletion: Removing an element from the data structure
Sorting: Arranging the elements in some type of order
Merging: Combining two similar data structures into one

Hash table
A hash table, or a hash map, is a data structure that associates keys with values. A function termed
as Hash function is applied on the key to find the address of the record.

Non-linear structures
A data structure is said to be non-linear if its elements are not in a sequence. The elements in the
data structure are not arranged in a linear manner; rather it has a branched structure.
Some of the non- linear structures are:
Tree: Collection of nodes represented in hierarchical fashion
Graph: Collection of nodes connected together through edges

1.3 Selecting a Data Structure


Data structures that suit certain applications may not suit certain other applications. The choice of
the data structure often begins from the choice of an abstract data structure – an abstract storage
for data defined in terms of the set of operations to be performed on data and computational
complexity for performing these operations, regardless of the implementation in a concrete data
structure.
Selection of an abstract data structure is crucial in the design of efficient algorithms and in
estimating their computational complexity, while selection of concrete data structures is important
for efficient implementation of algorithms. The difficulty of implementation and the quality and
performance of the final result depends heavily on choosing the best data structure.

1.4 Role of Data Structure


i. You use a structure to access parts of a data
ii. You use a structure to group together related data.
iii. You use a structure to declare an instance of data group
Revision questions
1. Define the term data structure
2. Explain the categories of data structures
3. Explain the importance of a data structure in programming
4. Describe operations that can be performed on data structures

You might also like