Analysis and design of algorithms (ada) notes
A data structure is
a particular way of organizing data in a computer so that it can be used
effectively.
For example, we can store a list of items having
the same data-type using the array data
structure.
data
structure name indicates itself that organizing the data in memory. There are
many ways of organizing the data in the memory as we have already seen one of
the data structures, i.e., array in C language. Array is a collection of memory
elements in which data is stored sequentially, i.e., one after another. In
other words, we can say that array stores the elements in a continuous manner.
This organization of data is done with the help of an array of data structures.
There are also other ways to organize the data in memory. Let's see the
different types of data structures.
data structure is a specialized format for organizing, processing, retrieving and storing data.
Stack is a linear data structure which follows a particular order in which the operations are performed. a stack is a last in, first out (LIFO) structure. A real-life example is a stack of plates: you can only take a plate from the top of the stack, and you can only add a plate to the top of the stack. If you want to reach a plate that is not on the top of the stack, you need to remove all of the plates that are above that one. In the same way, in a stack data structure, you can only access the element on the top of the stack.
The main stack
operations are:
- push(): When
we insert an element in a stack then the operation is known as a push. If the
stack is full then the overflow condition occurs.
- pop(): When
we delete an element from the stack, the operation is known as a pop. If
the stack is empty means that no element exists in the stack, this state
is known as an underflow state.
to the topmost element of the stack. Whenever an element is added in the stack, it is added on the top of the stack, and the element can be deleted only from the stack. In other words,
Stack works on the
LIFO pattern. As we can observe in the below figure there are five memory
blocks in the stack; therefore, the size of the stack is 5.
sequence of operation is to be carried out in order to solve a specific problem or class of problems is called an Algorithm.
Our ADA Tutorial includes all topics of algorithm, asymptotic analysis, algorithm control structure, recurrence, master method, recursion tree method, simple sorting algorithm, bubble sort, selection sort, insertion sort, divide and conquer, binary search, merge sort, counting sort, lower bound theory etc.
Comments
Post a Comment