Data Structures in C

Data Structures in C are used to store data in an organised and efficient manner. The C Programming language has many data structures like an array, stack, queue, linked list, tree, etc. A programmer selects an appropriate data structure and uses it ac…


This content originally appeared on DEV Community and was authored by Dhanush302

Data Structures in C are used to store data in an organised and efficient manner. The C Programming language has many data structures like an array, stack, queue, linked list, tree, etc. A programmer selects an appropriate data structure and uses it according to their convenience.

Let us look into some of these data structures:
ARRAY:
An Array is a sequential collection of elements, of the same data type. They are stored sequentially in memory. An Array is a data structure that holds a similar type of elements. The array elements are not treated as objects in c like they are in java.
There are two types of arrays:

  • Single dimensional array
  • Multidimensional array

STACK:
A stack is a linear data structure. It follows the last in first out approach. A new item is added at the top of a stack. Both insert and deletion operation is performed from one end of the stack.
There are two functions associated with stacks. Push function to add elements to the stack and pop function to remove elements from the stack. Similar to Stack, we have another data structure called Queue.

QUEUE:
A Queue is a linear data structure that stores a collection of elements. The queue operates on first in first out (FIFO) algorithm.
There are 2 pointers, the front is at the front of the queue and rear is at the back of the queue. We add elements from the back of the queue and remove them from the front of the queue.


This content originally appeared on DEV Community and was authored by Dhanush302


Print Share Comment Cite Upload Translate Updates
APA

Dhanush302 | Sciencx (2021-11-25T12:44:43+00:00) Data Structures in C. Retrieved from https://www.scien.cx/2021/11/25/data-structures-in-c/

MLA
" » Data Structures in C." Dhanush302 | Sciencx - Thursday November 25, 2021, https://www.scien.cx/2021/11/25/data-structures-in-c/
HARVARD
Dhanush302 | Sciencx Thursday November 25, 2021 » Data Structures in C., viewed ,<https://www.scien.cx/2021/11/25/data-structures-in-c/>
VANCOUVER
Dhanush302 | Sciencx - » Data Structures in C. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/25/data-structures-in-c/
CHICAGO
" » Data Structures in C." Dhanush302 | Sciencx - Accessed . https://www.scien.cx/2021/11/25/data-structures-in-c/
IEEE
" » Data Structures in C." Dhanush302 | Sciencx [Online]. Available: https://www.scien.cx/2021/11/25/data-structures-in-c/. [Accessed: ]
rf:citation
» Data Structures in C | Dhanush302 | Sciencx | https://www.scien.cx/2021/11/25/data-structures-in-c/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.