Friday, April 18, 2025
Types of Data structure

Data structure: Data structure एक बहुत ही important programming concept हैं। वे हमें एक efficient तरीके से data को store करने, Organize करने और पुनः retrieve करने का साधन provide करते हैं। data structures का use हमारे data के साथ work करने के लिए किया जाता है, easier। कई data structures हैं जो हमें इसमें help करती हैं।

data types1. Primitive Data structures
2. Non-Primitive Data structures

1. Primitive Data structures: ये structures हैं जो machine level पर supported हैं, उनका उपयोग non-primitive data structures को बनाने के लिए किया जा सकता है। ये अभिन्न हैं और रूप में शुद्ध हैं। उन्होंने behavior and specifications को predefined किया है।

Primitive Data structures Types:

  1. char
  2. int
  3. float
  4. Pointers

1. char :
इस data type का use किसी single character को store करने के लिए किया जाता है। character को ‘E’ या ‘e’ जैसे single quotes में enclosed किया जाना चाहिए। Alternative रूप से, आप कुछ characters को display करने के लिए ASCII values का भी use कर सकते हैं।

2. int :
यह data type -2147483648 से 2147483647 तक पूरे number store कर सकता है। आम तौर पर, जब आप एक numeric value के साथ variables बनाते हैं तो int preferred data type होता है।

3. float :
यह data type 3.4e to 038 से 3.4e + 038 तक fractional numbers को store कर सकता है। ध्यान दें कि आपको “f” के साथ value को end करना चाहिए।

4. Pointers :
Pointers वे variables हैं जो memory में present value के location को store करने के लिए use किए जाते हैं। एक location के लिए एक pointer अपने memory address को store करता है। एक pointer द्वारा संदर्भित किए जा रहे स्थान पर store value प्राप्त करने की process को dereferencing के रूप में जाना जाता है।

2. Non-Primitive Data Types:
non-primitive data structures को primitive data structures के बिना नहीं किया जा सकता है। हालाँकि, वे भी system द्वारा ही provide किए जाते हैं, फिर भी वे derived data structures हैं और इन्हें primitive data structures का use किए बिना नहीं बनाया जा सकता है।
Non-primitive data structures को following categories में divide किया गया है:

  1. Arrays
  2. Files
  3. Lists

1. Arrays:
Arrays same data types का एक homogeneous and contiguous collection है। उनके पास एक static memory allocation technique है, जिसका अर्थ है, यदि memory space एक बार के लिए allocate किया गया है, तो इसे runtime के दौरान change नहीं किया जा सकता है। array का use vectors, matrices और अन्य data structures को लागू करने के लिए किया जाता है। यदि हम पहले से allocate की जाने वाली memory को नहीं जानते हैं, तो सरणी memory का wastage कर सकती है। इसके अलावा, insertions and deletions array में complex हैं क्योंकि elements को लगातार memory allocations में store किया जाता है।

2. Files:
एक file records का एक collection है। file data structure का use मुख्य रूप से large amounts में data के managing के लिए किया जाता है जो system के primary storage में नहीं है। files easily से इस तरह के data के साथ काम करने, manage करने, access करने और retrieve करने या मूल रूप से work करने में हमारी help करती हैं।

3. Lists:
Lists dynamic memory allocation का support करती हैं। allocate की गई memory space को run time में भी बदला जा सकता है।Lists दो type की हैं:
a) Linear Lists:
linear lists वे होती हैं जिनके पास sequential order में elements stored होते हैं। lists में insertions and deletions आसान हैं। वे दो types में divided हैं:

  1. Stacks: Stacks elements को store करने और retrieve करने के लिए एक “LIFO” technique को follow करता है। जो element end में store किया जाता है, वह stack से retrieved करने वाला पहला होगा। stack में following primary functions हैं:
    Push(): Stack में एक element insert करने के लिए।
    Pop(): Stack से एक element को remove के लिए।
  2. Queues: Queues elements को store करने और retrieve करने के लिए “FIFO” mechanism का पालन करती हैं। जिन तelements को पहले Queues में store किया जाता है, वे Queues से निकाले जाने वाले पहले element होंगे। “ENQUEUE” operation का use Queues में किसी element को सम्मिलित करने के लिए किया जाता है जबकि “DEQUEUE” operation का use stack से किसी element को निकालने के लिए किया जाता है।

b) Non Linear Lists
non linear lists में एक certain manner से elements stored नहीं होते हैं। य़े हैं:

  1. Graphs: Graph data structure का use network को represent करने के लिए किया जाता है। इसमें vertices and edges शामिल हैं। जब network का अध्ययन करने की बात आती है तो graph बहुत useful होते हैं।
  2. Trees: Tree data structure में एक particular arrangement में जुड़े nodes शामिल हैं और वे data items पर search operations को easy बनाते हैं। tree data structures में एक root node होता है जो आगे विभिन्न बच्चे nodes और इतने पर devide होता है। tree के levels की संख्या को tree की height भी कहा जाता है।
My name is Yash Pogra and I am the chief blogger at Codeash and where I like to share my internet/tech experience with my online readers on this website. I have been a webmaster from 2015 which is when I had registered my first company by the name Codeash. I have ventured into different online businesses like offering SEO Services, Digital Marketing and website development services.

Related Article

0 Comments

Leave a Comment