{"id":84455,"date":"2021-09-09T09:00:09","date_gmt":"2021-09-09T03:30:09","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=84455"},"modified":"2021-09-09T09:00:09","modified_gmt":"2021-09-09T03:30:09","slug":"cpp-data-structures","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/","title":{"rendered":"Data Structures in C++"},"content":{"rendered":"<p>As we know that the C++ programming language offers several exciting and useful features and functionalities to its users. And it also does support object-oriented programming. With this technique, you can perform some major methods such as Encapsulation, Abstraction, Inheritance, Polymorphism etc. In C++, data structures are a useful and inescapable part of programming. With the help of data structures, we perform operations on data such as data representation, storage, organization and many more.<\/p>\n<h3>What are Data Structures<\/h3>\n<p>With the help of data structures, you can organize data in a particular way so that it can be used effectively. There are several ways to organize the data in memory.<\/p>\n<p>Let me tell you that it is not a programming language, it is a set of algorithms which one can use to structure data into memory in any programming language.<\/p>\n<p>Below, we stored a list of items using the array data structure.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/08\/C-Data-Structures-normal-image01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-84605\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/08\/C-Data-Structures-normal-image01.jpg\" alt=\"Array data structure in C++\" width=\"605\" height=\"302\" \/><\/a><\/p>\n<h3>Data Types C++<\/h3>\n<p>It is just a group of similar data under a single name. Data types that are similar share similar characteristics and behave in a similar way.<\/p>\n<p>For example, if you want to store the address of a person or house then you should use \u2018string\u2019 data type.<\/p>\n<p>Data types are categorized into two broad categories:-<\/p>\n<p><strong>1. Primitive Data Type:-<\/strong> These are pre-defined data types. It is also known as fundamental data types. Example:- int, float, double, char, string etc.<\/p>\n<p><strong>2. Non-Primitive Data Type<\/strong>:- These are user-defined data types. Example:- array, structures, unions, structures, linked lists etc.<\/p>\n<h3>Types of Data Structures in C++<\/h3>\n<p>In C++, data structures are further categorized into 3 types.<\/p>\n<h4>1. Simple Data Structures<\/h4>\n<p>These data structures are built from primitive data types like int, float, double, char etc.<\/p>\n<p><strong>Example<\/strong>:- An array is a data structure that holds the same data type and the structure is also a data type that holds different data types.<\/p>\n<h4>2. Compound Data Structures<\/h4>\n<p>You can also build compound data structures by combining simple data structures. Compound data structures are classified into:-<\/p>\n<p><strong>a. Linear Data Structure:<\/strong>&#8211; If the elements of a data structure are ordered in sequence then it is a linear data structure. Example:- stacks, queues and linked lists.<\/p>\n<p><strong>b. Non-Linear Data Structure:<\/strong>&#8211; These data structures are not linear. These are multilevel data structures. Example:- trees, graphs etc.<\/p>\n<h4>3. Static and Dynamic Data Structures<\/h4>\n<p>Static data structures are constant in size and structure. It is associated with specific memory locations fixed at compilation time.<\/p>\n<p>You can expand or contract a data structure according to your needs during the execution of the program. And these types of data structures are known as Dynamic Data Structure.<\/p>\n<h4>Operations on Data Structures<\/h4>\n<p>Below are the basic operations which you can perform on the data structures in C++:-<\/p>\n<ul>\n<li><strong>Insertion:<\/strong> Adding a new data element into the data structure.<\/li>\n<li><strong>Deletion:<\/strong> This operation is about deleting or removing an existing data element from the data structure.<\/li>\n<li><strong>Traversal:<\/strong> This operation is about processing and displaying all the data elements in the data structure.<\/li>\n<li><strong>Searching:<\/strong> Searching a specific data element in the data structure.<\/li>\n<li><strong>Sorting:<\/strong> This operation is about arranging all the data elements in the data structure either in ascending or descending order.<\/li>\n<li><strong>Merging:<\/strong> This operation is about combining similar data elements from two or more data structures.<\/li>\n<\/ul>\n<h3>C++ Arrays<\/h3>\n<p>Arrays are simply a collection of similar data types stored at contiguous memory locations. It can store primitive types of data like int, char, float, double etc. With the help of the arrays, a programmer can access the elements very easily.<\/p>\n<p>Suppose, you want to store marks of 20 students then you might try to declare 20 variables like student1_marks, student2_marks etc. But what if i tell you that you can do all those with a single variable named array. With the help of a few lines of code, you can access those elements.<\/p>\n<table style=\"height: 73px\" width=\"854\">\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">6<\/span><\/td>\n<td><span style=\"font-weight: 400\">9<\/span><\/td>\n<td><span style=\"font-weight: 400\">8<\/span><\/td>\n<td><span style=\"font-weight: 400\">5<\/span><\/td>\n<td><span style=\"font-weight: 400\">3<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\"> 0<\/span>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span style=\"font-weight: 400\">1<\/span> <span style=\"font-weight: 400\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 2<\/span> <span style=\"font-weight: 400\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a03<\/span> <span style=\"font-weight: 400\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a04<\/span><\/p>\n<p style=\"text-align: center\"><b>\u00a0 \u00a0Array of size 5<\/b><\/p>\n<p><strong>Syntax for declaring an array:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dataType array_name[arraySize];\n<\/pre>\n<p><strong>So, if you want to access the second element of the above array, then you have to do:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cout&lt;&lt;array[1]<\/pre>\n<p><strong>Example:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;iostream&gt;\nusing namespace std;\nint main()\n{\nint numbers[3] = {2, 3, 4};\ncout&lt;&lt;\"First number is: \"&lt;&lt;numbers[0]&lt;&lt;endl;\ncout&lt;&lt;\"Last number is: \"&lt;&lt;numbers[2];\n}\n<\/pre>\n<p><strong>Output:-<\/strong><\/p>\n<div class=\"code-output\">First number is: 2<br \/>\nLast number is: 4<\/div>\n<h3>C++ Linked List<\/h3>\n<p>A linked list can be defined as a collection of connected nodes. It is a linear data structure. A linked list contains two parts such as:-<\/p>\n<ul>\n<li><strong>Data Part:-<\/strong> Contains the data of the user.<\/li>\n<li><strong>Pointer Part:-<\/strong> It points to the next member of the linked list.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/08\/C-Data-Structures-normal-image02.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-84606\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/08\/C-Data-Structures-normal-image02.jpg\" alt=\"Linked List in C++\" width=\"924\" height=\"245\" \/><\/a><\/p>\n<p>In the above image, <strong>Head<\/strong> contains the address of the first node. And the last node in the linked list points to <strong>NULL.<\/strong><br \/>\nNodes are stored at different locations.<\/p>\n<p>There are three types of linked list such as Singly Linked List, Doubly Linked List and Circular Linked List.<\/p>\n<p>Below, we have created a singly linked list of three members.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/ Node Initializing!\nstruct node *HEAD;\nstruct node *ONE = NULL;\nstruct node *TWO = NULL;\nstruct node *THREE = NULL;\n\n\/\/ Allocating memory!\nONE = malloc(sizeof(struct node));\nTWO = malloc(sizeof(struct node));\nTHREE = malloc(sizeof(struct node));\n\n\/\/ Assigning the values of data!\nONE-&gt;data = 23;\nTWO-&gt;data = 34;\nTHREE-&gt;data = 90;\n\n\/\/ Connecting nodes with each other!\nONE-&gt;next = TWO;\nTWO-&gt;next = THREE;\nTHREE-&gt;next = NULL;\n\n\/\/ Saving the address of first node\nHEAD = ONE;\n<\/pre>\n<h3>Stack in C++<\/h3>\n<p>Stack is known as a linear data structure. It follows the Last-In-First-Out rule. So, if you push something to the stack then the last value which you pushed, will be the first to pop out. The insertion and deletion operation on the stack will only take place from one end which is the top of the stack.<\/p>\n<p>In 2 ways, you can implement a stack in C++:-<\/p>\n<p><strong>1. Statically:-<\/strong> You can implement a stack using an array. It allows static memory allocation of its data elements. In this, the stack inherits all the features of the array.<\/p>\n<p><strong>2. Dynamically:-<\/strong> You can also implement a stack using a linked list. It allows dynamic memory allocation of its data elements. In this, the stack takes over the characteristics of the linked list.<\/p>\n<h3>Queue in C++<\/h3>\n<p>Queue is known as a linear data structure. It follows the First-In-First-Out rule. So, if you push something to the stack then the first value of the stack will pop out. In the queue, the insertion operation is possible from the rear end(back) and the deletion is from the front.<\/p>\n<p>In 2 ways, you can implement the queue:-<\/p>\n<p><strong>1. Statically:-<\/strong> You can implement a queue using an array. It allows static memory allocation of its data elements. In this, the queue inherits all the features of the array.<\/p>\n<p><strong>2. Dynamically:-<\/strong> You can also implement a queue using a linked list. It allows dynamic memory allocation of its data elements. In this, the queue takes over the characteristics of the linked list.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/08\/C-Data-Structures-normal-image03.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-84607\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/08\/C-Data-Structures-normal-image03.jpg\" alt=\"Stacks and queues in C++\" width=\"798\" height=\"408\" \/><\/a><\/p>\n<h3>C++ Trees<\/h3>\n<p>It is a bit of a complex and complicated data structure.<\/p>\n<p>A tree is known as a finite and non-empty set of elements in mathematical terms. Trees are hierarchical data structures. A tree includes multiple nodes. This data structure follows the parent-child relationship. It is not a linear data structure like array, structure, linked lists etc. It is a non-linear data structure.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/08\/C-Data-Structures-normal-image04.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-84608\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/08\/C-Data-Structures-normal-image04.jpg\" alt=\"Trees in C++\" width=\"684\" height=\"497\" \/><\/a><\/p>\n<h3>C++ Structure<\/h3>\n<p>The structure is a user-defined data type. It works similarly like arrays. Structures help you in grouping items of different types in a single group. It stores the collection of different data types. Each element of structure is a member.<\/p>\n<h3>Defining a structure in C++:-<\/h3>\n<p>Before creating variables of structure, you have to define it first. You can use the <strong>struct<\/strong> keyword to define structures.<\/p>\n<p><strong>Syntax:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">struct name_of_the_structure \n{\n    data_type member1;\n    data_type member2;\n    ...\n    data_type memberN;\n};\n<\/pre>\n<p><strong>Example:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">struct bill\n{\n   float amount;\n   int id;\n   char address[100];\n};\n<\/pre>\n<p>In the above example, we have defined a structure named <strong>bill.<\/strong> And the members of this structure are <strong>amount, id<\/strong> and <strong>address.<\/strong><\/p>\n<h3>Accessing members of structures in C++:-<\/h3>\n<p>Before using the structure variables, you will have to access the members of the structure. There are 2 ways to access the member of the structure:-<\/p>\n<ul>\n<li>Use . operator<\/li>\n<li>Use -&gt; operator (structure pointer operator)<\/li>\n<\/ul>\n<p>Suppose, you want to access the amount member of the p1 variable from the above example then you can use . operator like below:-<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">p1.amount;<\/pre>\n<p><strong>Example:- Accessing members of structures<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;iostream&gt;\nusing namespace std;\nstruct Tech{\n  int a = 0;\n  int b = 1;\n};\nint main()\n{\n  struct Tech t1;\n  cout &lt;&lt; \"a: \" &lt;&lt; t1.a &lt;&lt; \" and b: \" &lt;&lt; t1.b&lt;&lt;endl;\n  t1.a = 5;\n  t1.b = 10;\n  cout &lt;&lt; \"a: \" &lt;&lt; t1.a &lt;&lt; \" and b: \" &lt;&lt; t1.b;\n  return 0;\n}\n<\/pre>\n<p><strong>Output:-<\/strong><\/p>\n<div class=\"code-output\">a: 0 and b: 1<br \/>\na: 5 and b: 10<\/div>\n<h3>Structure as function arguments<\/h3>\n<p>You can also pass a function to structures. It helps you in making your coding better and efficient.<\/p>\n<p><strong>Example:- passing function to structures<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;iostream&gt;\n#include &lt;string.h&gt;\nusing namespace std;\nstruct info {\n   char student_name[50];\n   char favorite_subject[20];\n   int id;\n};\nvoid display( struct info each_student );\nint main() {\n   struct info s1;  \t \n   strcpy( s1.student_name, \"Tom Sawer\");\n   strcpy( s1.favorite_subject, \"English\");\n   s1.id = 20;\n\/\/ printing first student details!\n   display(s1);\n   return 0;\n}\n\nvoid display( struct info each_student ) {\n   cout&lt;&lt;\"Name of first student: \"&lt;&lt; each_student.student_name&lt;&lt;endl;\n   cout&lt;&lt;\"Favourite subject of first student: \"&lt;&lt;each_student.favorite_subject&lt;&lt;endl;\n   cout&lt;&lt;\"ID of first student: \"&lt;&lt;each_student.id&lt;&lt;endl;\n}\n<\/pre>\n<p><strong>Output:-<\/strong><\/p>\n<div class=\"code-output\">Name of first student: Tom Sawer<br \/>\nFavourite subject of first student: English<br \/>\nID of first student: 20<\/div>\n<h3>Summary<\/h3>\n<p>In this tutorial, we discussed the data structures and data types in C++. We also discussed the different types of data structures such as simple, compound, static and dynamic data structures. Then we talked over the arrays, stack and queues, linked list, and trees in this tutorial.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As we know that the C++ programming language offers several exciting and useful features and functionalities to its users. And it also does support object-oriented programming. With this technique, you can perform some major&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":84604,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3405],"tags":[3898,4227,3990,4228,4229,4230],"class_list":["post-84455","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpp","tag-arrays-in-c","tag-c-data-structures","tag-linked-list-in-c","tag-queue-in-c","tag-stack-in-c","tag-trees-in-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Data Structures in C++ - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn what are data structures in C++ and its types like simple, compound, static &amp; dynamic. See arrays, stacks, queues, linked list &amp; trees.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Structures in C++ - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn what are data structures in C++ and its types like simple, compound, static &amp; dynamic. See arrays, stacks, queues, linked list &amp; trees.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-09T03:30:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/08\/C-Data-Structures.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data Structures in C++ - TechVidvan","description":"Learn what are data structures in C++ and its types like simple, compound, static & dynamic. See arrays, stacks, queues, linked list & trees.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/","og_locale":"en_US","og_type":"article","og_title":"Data Structures in C++ - TechVidvan","og_description":"Learn what are data structures in C++ and its types like simple, compound, static & dynamic. See arrays, stacks, queues, linked list & trees.","og_url":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-09-09T03:30:09+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/08\/C-Data-Structures.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Data Structures in C++","datePublished":"2021-09-09T03:30:09+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/"},"wordCount":1387,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/08\/C-Data-Structures.jpg","keywords":["Arrays in C","c++ data structures","Linked List in C","Queue in C++","Stack in C++","Trees in C++"],"articleSection":["C++ Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/","url":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/","name":"Data Structures in C++ - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/08\/C-Data-Structures.jpg","datePublished":"2021-09-09T03:30:09+00:00","description":"Learn what are data structures in C++ and its types like simple, compound, static & dynamic. See arrays, stacks, queues, linked list & trees.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/08\/C-Data-Structures.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/08\/C-Data-Structures.jpg","width":1200,"height":628,"caption":"C++ Data Structures"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/cpp-data-structures\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Data Structures in C++"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/84455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=84455"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/84455\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/84604"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=84455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=84455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=84455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}