Understanding Data Structures & Algorithms: Basic Concepts, Types & Abstracts, Lecture notes of Data Structures and Algorithms

An introduction to data structures and algorithms, covering the fundamental concepts of data definition, data objects, data types, and basic operations. It explains built-in and derived data types, such as integers, boolean, floating, character, strings, lists, arrays, stacks, queues, and abstract data types (ADTs). The document also discusses the importance of abstract data types, their interface and implementation, and various data structures like linear structures (arrays, linked lists, stacks, queues, priority queues, trees, hash tables, and graphs).

Typology: Lecture notes

2020/2021

Uploaded on 08/14/2021

Maine06042002
Maine06042002 🇵🇭

2 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CPE 221
Data Structure and Algorithm
Basic Concepts
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Understanding Data Structures & Algorithms: Basic Concepts, Types & Abstracts and more Lecture notes Data Structures and Algorithms in PDF only on Docsity!

CPE 221

Data Structure and Algorithm

Basic Concepts

Data Definition defines a particular data with the

following characteristics:

Atomic. Definition should define a single

concept.

Traceable. Definition should be able to be

mapped to some data element.

Accurate. Definition should be unambiguous.

Clear and Concise. Definition should be

understandable.

Built-in Data Type

Those data types for which a language has built-

in support are known as Built-in Data types. For

example, most of the languages provide the

following built-in data types.

Integers

Boolean (true, false)

Floating (Decimal numbers)

Character and Strings

Derived Data Type

Those data types which are implementation

independent as they can be implemented in one

or the other way are known as derived data types.

These data types are normally built by the

combination of primary or built-in data types and

associated operations on them. For example −

List

Array

Stack

Queue

Basic Operations

Sorting: This operation involves arranging the elements in a data

structure in a particular order either ascending or descending.

There are various sorting algorithms that are available for data

structures.

Traversing: We say that we traverse a data structure when we visit

each and every element in the structure. Traversing is required to

carry out certain specific operations on the data structure.

Merging: This operation is combining the records in two different

file into a single file. Combining elements of two similar data

structures to form a new data structure of the same type.

Abstract data type (ADTs)

A data type that is defined entirely by a set of operations is referred

to as Abstract data type or simply ADT

Abstract data types are a way of separating the specification and

representation of data types

An ADT is a black box, where users can only see the syntax and

semantics of its operations

An ADT is a combination of interface and implementation The

interface defines the logical properties of the ADT and especially

the signatures of its operations

The implementation defines the representation of data structure and

the algorithms that implement the operations

An abstract data type encapsulates data and functions into a named

data type

Data Structures: Data Collections

Linear structures

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

Tree: A branching structure with no loops

Hash tables: Unordered lists which use a ‘hash function’ to

insert and search

Graph: A more general branching structure, with less

stringent connection conditions than for a tree

ADTs Collection

ADT is a data structure and a set of operations which can be

performed on it.

  • (^) A class in object-oriented design is an ADT

The pre-conditions define a state of the program which the client

guarantees will be true before calling any method

post-conditions define the state of the program that the object's

method will guarantee to create for you when it returns.

create: Create a new collection

add: Add an item to a collection

delete: Delete an item from a collection find Find an item matching

some criterion in the collection

destroy: Destroy the collection

References

  • https://www.tutorialspoint.com/data_structures

_algorithms/index.htm

  • https://www.slideshare.net/DhavalKaneria/intro

duction-to-data-structures-and-algorithm-

665

  • (^) https://www.softwaretestinghelp.com/cpp-tutori

als/

  • https://scanftree.com/Data_Structure/