**Data Structure:-***The data structure can be defined as the collection of elements and all the possible operations which are required for those set of elements. The operations includes inserting, deleting, searching and printing an element. It is the way of representing logical relationship between individual data elements.*

*Data structure is the representation of the logical relationship existing between individual elements of data.*

*A data structure is a way of organizing all data items that considers not only the elements stored but also their relationship to each other.*

*Read Also:*

*Data structure is define as a mathematical or logical model of particular organization of data items. Data structure mainly specifies the following four things:*

*Organization of data**Accessing methods**Degree of associativity**Processing alternatives for information*

**Type Of Data Structure:-**The data structures are divided into the following two categories:

**1. Linear data structure:**A linear data structure is a data structure whose elements form a sequence, and every element in the structure has a unique predecessor and unique successor.*Examples of linear data structure are arrays, linked lists, stacks and queues.*

**2. Non-linear data structure:**It is a data structure whose elements do not form a sequence. There is no unique predecessor or unique successor.*Examples of non-linear data structures are trees and graphs.*

*Types Of Liner Data Structure:- There are many types of liner Data Structure, which listed below:*

*Array**Linked List**Stack**Queue*

**1. Array:-**Click Here To Know.

**2. Linked List:-**Click Here To Know

**3. Stack:-**A stack is a ordered collection of data elements. The elements already stored may be deleted or new elements may be inserted at one end, called the top of the stack. It is a data structure in which only the top element can be accessed.*Unlike array, the definition of the stack provides for insertion and deletion of items, so that stack is a dynamic, constantly changing object. Removing the data element from a stack is called Poping the stack or pop operation and storing an element on the stack is called pushing it onto the stack or push operation. The information stored on the stack much like stacking plates. Using this analogyo stacking plates it is easy to illustrate the stach operation.*

*It is an ordered list in all insertions and deletions are made at one which end, called shown in the figure, if we have stack of elements 10, 20, 30, 40, 50, 60 then 10 will be the bottommost element and 60 will be the topmost element in the stack.*

*Let us see the operations which can be carried out on the stack.*

*To create a stack.**To insert an element onto the stack.**To delete an element from the stack.**To check which element is at the top of the stack.**To check whether a stack is empty or not.*

*The create function creates a stack in the memory. The way we create a stack and carry out all other operations depend on how the stack is implemented. The insert function inserts a new element at the top of the stack, while the delete function removes the element which is at the top of the stack. Many times we need to test for the topmost element of the stack and to test whether the stack is empty or Honempty before we make subsequent operations. The function which tests for the cmptiness of the stack, say, 'stempty' is a boolean function which returns true if the ack is empty and false otherwise. Similarly, a function, say, 'stfull' is a boolean function which tests whether the stack is full or not. It returns true if it is full and false otherwise.*

**Declaration:**A stack in C can be declared as a structure containing two objects: an array to hold the elements of the stack, and an integer to indicate the position of the current top of stack within the array.
## 2 Comments

This is short, post more

ReplyDeleteGood

ReplyDelete