GoConqr has a new look! Let us know what you think.

Notes

python

binny gupta Engineering English 2 pages

Content of the notes (2)

Page 1

Python - Data Structure

Computers store and process data with extraordinary speed and accuracy. So it is highly essential that the data is stored efficiently and can be accessed fast. Also, the processing of data should happen in the smallest possible time but without losing accuracy.

Data structures deal with how the data is organized and held in the memory when a program processes it.

An Algorithm is a step-by-step set of instructions to process the data for a specific purpose. So an algorithm utilizes various data structures in a logical way to solve a specific computing problem.

Data structures are fundamental concepts of computer science that help in writing efficient programs in any language.

General Data Structures

The various data structures in computer science are divided broadly into two categories shown below. We will discuss each of the below data structures in detail in subsequent chapters.

Linear Data Structures

These are the data structures that store the data elements in a sequential manner.

Array: It is a sequential arrangement of data elements paired with the index of the data element.

Linked List: Each data element contains a link to another element along with the data present in it.

Stack: It is a data structure that follows only the specific order of operation. LIFO(last in First Out) or FILO(First In Last Out).

Queue: It is similar to Stack but the order of operation is only FIFO(First In First Out).

Matrix: It is a two-dimensional data structure in which the data element is referred by a pair of indices.

Non-Liner Data Structures

These are the data structures in which there is no sequential linking of data elements. Any pair or group of data elements can be linked to each other and can be accessed without a strict sequence.

Binary Tree: It is a data structure where each data element can be connected to a maximum of two other data elements and it starts with a root node.

Heap: It is a special case of Tree data structure where the data in the parent node is either strictly greater than/ equal to the child nodes or strictly less than its child nodes.

Hash Table: It is a data structure that is made of arrays associated with each other using a hash function. It retrieves values using keys rather than index from a data element.

Graph: It is an arrangement of vertices and nodes where some of the nodes are connected to each other through links.

Python Specific Data Structures

These data structures are specific to the python language and they give greater flexibility in storing different types of data and faster processing in the python environment.

List: It is similar to an array with the exception that the data elements can be of different data types. You can have both numeric and string data in a python list.

Tuple: Tuples are similar to lists but they are immutable which means the values in a tuple cannot be modified they can only be read.

Dictionary: The dictionary contains Key-value pairs as its data elements.

Page 2

Information

Description
Engineering Note on python , created by binny gupta on 09/04/2021.
Created by
binny gupta
Views
2
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?