Загрузка страницы

Time And Space Complexity || Data Structures and Algorithm || Saral Bhasha me

Time And Space Complexity || Data Structures and Algorithm || Saral Bhasha me

space and time complexity of an algorithm
space and time complexity in data structure
space and time complexity in data structure in hindi

#spaceandtimecomplexity
#datastructuresandalgorithm #Clanguage #c++ #algorithm #gate #aktuexams #aktu #ugc

Algorithm Analysis
Analysis of efficiency of an algorithm can be performed at two different stages, before implementation and after implementation, as

A priori analysis − This is defined as theoretical analysis of an algorithm. Efficiency of algorithm is measured by assuming that all other factors e.g. speed of processor, are constant and have no effect on implementation.

A posterior analysis − This is defined as empirical analysis of an algorithm. The chosen algorithm is implemented using programming language. Next the chosen algorithm is executed on target computer machine. In this analysis, actual statistics like running time and space needed are collected.

Algorithm analysis is dealt with the execution or running time of various operations involved. Running time of an operation can be defined as number of computer instructions executed per operation.

Algorithm Complexity
Suppose X is treated as an algorithm and N is treated as the size of input data, the time and space implemented by the Algorithm X are the two main factors which determine the efficiency of X.

Time Factor − The time is calculated or measured by counting the number of key operations such as comparisons in sorting algorithm.

Space Factor − The space is calculated or measured by counting the maximum memory space required by the algorithm.

The complexity of an algorithm f(N) provides the running time and / or storage space needed by the algorithm with respect of N as the size of input data.

Space Complexity
Space complexity of an algorithm represents the amount of memory space needed the algorithm in its life cycle.

Space needed by an algorithm is equal to the sum of the following two components

A fixed part that is a space required to store certain data and variables (i.e. simple variables and constants, program size etc.), that are not dependent of the size of the problem.

A variable part is a space required by variables, whose size is totally dependent on the size of the problem. For example, recursion stack space, dynamic memory allocation etc.

Space complexity S(p) of any algorithm p is S(p) = A + Sp(I) Where A is treated as the fixed part and S(I) is treated as the variable part of the algorithm which depends on instance characteristic I. Following is a simple example that tries to explain the concept

Algorithm
SUM(P, Q)
Step 1 - START
Step 2 - R ← P + Q + 10
Step 3 - Stop
Here we have three variables P, Q and R and one constant. Hence S(p) = 1+3. Now space is dependent on data types of given constant types and variables and it will be multiplied accordingly.

Time Complexity
Time Complexity of an algorithm is the representation of the amount of time required by the algorithm to execute to completion. Time requirements can be denoted or defined as a numerical function t(N), where t(N) can be measured as the number of steps, provided each step takes constant time.

For example, in case of addition of two n-bit integers, N steps are taken. Consequently, the total computational time is t(N) = c*n, where c is the time consumed for addition of two bits. Here, we observe that t(N) grows linearly as input size increase

Видео Time And Space Complexity || Data Structures and Algorithm || Saral Bhasha me канала Codemasters
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
8 сентября 2020 г. 12:45:01
00:19:28
Другие видео канала
Cache Mapping Techniques 3 || Computer Organisation and Architecture ||Detailed ExplanationCache Mapping Techniques 3 || Computer Organisation and Architecture ||Detailed ExplanationStructures and Functions|| Data Structures and Algorithms || Saral Bhasha meStructures and Functions|| Data Structures and Algorithms || Saral Bhasha meStatic And Dynamic Memory Allocation || Data Structures and Algorithms || Saral Bhasha meStatic And Dynamic Memory Allocation || Data Structures and Algorithms || Saral Bhasha meCache Mapping Techniques || Computer Organisation and Architecture ||Detailed ExplanationCache Mapping Techniques || Computer Organisation and Architecture ||Detailed ExplanationSandeep Maheshwari Inspires || Powerful Inspirational SpeechSandeep Maheshwari Inspires || Powerful Inspirational SpeechInstruction cycle State Transition Diagram ||Computer Organisation and Architecture||Saral Bhasha meInstruction cycle State Transition Diagram ||Computer Organisation and Architecture||Saral Bhasha meFloating Point Representation || Computer Architecture || HindiFloating Point Representation || Computer Architecture || HindiArrays Basics || Data Structures and Algorithms || Saral Bhasha meArrays Basics || Data Structures and Algorithms || Saral Bhasha meShri Ram Chandra Kripalu Bhajman ll by THE Gayak Brahmin ll Shri Ram Bhumi Pujan SpecialShri Ram Chandra Kripalu Bhajman ll by THE Gayak Brahmin ll Shri Ram Bhumi Pujan SpecialHardwired Control Unit | Computer Organization and Architecture | Saral Bhasha meHardwired Control Unit | Computer Organization and Architecture | Saral Bhasha meIntroduction to Computer Organisation and Architecture || Computer Organisation and ArchitectureIntroduction to Computer Organisation and Architecture || Computer Organisation and ArchitectureFloating point representation ||  Computer Architecture || HindiFloating point representation || Computer Architecture || HindiWhat every Indian Student must do || Don't miss these tips by Sir Walter lewin || Physics wallahWhat every Indian Student must do || Don't miss these tips by Sir Walter lewin || Physics wallahPointers to a Structure || Data Structures and Algorithms || Saral Bhasha mePointers to a Structure || Data Structures and Algorithms || Saral Bhasha meCache Mapping Techniques 2 || Computer Organisation and Architecture ||Detailed ExplanationCache Mapping Techniques 2 || Computer Organisation and Architecture ||Detailed ExplanationWho is a Teacher || unke kartavya kya haiWho is a Teacher || unke kartavya kya haiStructures in C || Data Structure and Algorithms || Saral Bhasha meStructures in C || Data Structure and Algorithms || Saral Bhasha meIntroduction to Data Structures || Data Structure and Algorithms || Saral Bhasha me!!!Introduction to Data Structures || Data Structure and Algorithms || Saral Bhasha me!!!Addressing modes | Computer Organisation and architectureAddressing modes | Computer Organisation and architectureYou Didn't come this far to only come this far!!!Ultimate motivation for jee,neet students!You Didn't come this far to only come this far!!!Ultimate motivation for jee,neet students!
Яндекс.Метрика