

{"id":9366,"date":"2018-03-01T08:06:05","date_gmt":"2018-03-01T08:06:05","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=9366"},"modified":"2026-05-28T15:23:19","modified_gmt":"2026-05-28T09:53:19","slug":"linear-data-structures-in-java","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/","title":{"rendered":"Linear Data Structures in Java &#8211; Array, Linked list, Stacks, and Queues"},"content":{"rendered":"<p><em>Linear data structures in Java are a way to organize the data in the language in a particular way so as to use them in the most effective way. The main reason to classify them is that we need less complexity and less space.<\/em><\/p>\n<p>There are 4 types of Java linear data structures; let&#8217;s study them one by one with real-time examples.<\/p>\n<p style=\"text-align: center\"><em><strong><span style=\"color: #993300\">WAIT, have you checked out what are <a href=\"https:\/\/data-flair.training\/blogs\/data-structures-in-java\/\">Data Structures in Java<\/a>? If you haven&#8217;t, check this out!!<\/span><\/strong><\/em><\/p>\n<h3>Linear Data Structures in Java<\/h3>\n<p>The main linear data structures in Java are:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-69447\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure.png\" alt=\"Linear Data Structure in Java with Example\" width=\"802\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure.png 802w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure-150x79.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure-300x157.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure-768x402.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure-520x272.png 520w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/a><\/p>\n<h3>Java Array<\/h3>\n<p><em>An array is used to store data of the type homogenous at a contiguous place; the size of the array is defined beforehand.<\/em><\/p>\n<p>Let the size of <em><strong><a href=\"https:\/\/data-flair.training\/blogs\/java-array\/\">Java array<\/a><\/strong><\/em> be n.<\/p>\n<ul>\n<li><strong>Accessing Time:<\/strong> O(1) [This is possible because it stores elements at contiguous locations]<\/li>\n<li><strong>Search Time:\u00a0<\/strong>O(n) for Sequential Search: O(log n) for Binary Search [If Array is sorted]<\/li>\n<li><strong>Insertion Time:<\/strong> O(n) [The worst case occurs when insertion happens at the beginning of an array and requires shifting all of the elements]<\/li>\n<li><strong>Deletion Time:<\/strong> O(n) [This is the worst case, which occurs when deletion occurs at the start of an array and requires shifting all of the elements]<\/li>\n<\/ul>\n<p><strong>Java Array Example\u00a0<\/strong><\/p>\n<p>For storing the marks of a student, we can create an array, as this saves us from using a different variable for every subject; we can simply add data by traversing the array.<\/p>\n<p><em><strong>Explore another User-Defined Data Type &#8211; <a href=\"https:\/\/data-flair.training\/blogs\/java-string-methods-and-constructor\/\">String in Java<\/a><\/strong><\/em><\/p>\n<h3>Java Linked List<\/h3>\n<p><em>A linked list is another important linear data structure in Java, similar to an array, with the only difference that here every element (we call it a \u2018node\u2019) is treated as a separate object.\u00a0<\/em><\/p>\n<p>A linked list contains a node that has a value and the address of the next block. A linked list has multiple nodes connected, just like the blocks of the train are connected.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linked-list-in-java.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-69145\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linked-list-in-java.jpg\" alt=\"Linked list in java\" width=\"500\" height=\"400\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linked-list-in-java.jpg 500w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linked-list-in-java-150x120.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linked-list-in-java-300x240.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p><strong>Types of Linked List in Java-<\/strong><\/p>\n<h4>1. Singly linked list<\/h4>\n<p>A singly linked list stores data and the reference to the next node or a null value.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Singly-linked-list-in-Java.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-69444 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Singly-linked-list-in-Java.jpg\" alt=\"Java Singly Linked List with Example\" width=\"800\" height=\"200\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Singly-linked-list-in-Java.jpg 800w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Singly-linked-list-in-Java-150x38.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Singly-linked-list-in-Java-300x75.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Singly-linked-list-in-Java-768x192.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Singly-linked-list-in-Java-520x130.jpg 520w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<h4>2. Doubly linked list<\/h4>\n<p>It is the same as a double-linked list, with the difference that it has two references, one for the last node and one for the previous node. This helps us traverse in both the directions and also we don\u2019t need explicit permission for the deletion of nodes.<\/p>\n<p><em><strong>Do you know <a href=\"https:\/\/data-flair.training\/blogs\/bubble-sort-in-java\/\">how to implement Bubble Sort in Java?<\/a><\/strong><\/em><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Doubly-linked-list.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-69147\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Doubly-linked-list.jpg\" alt=\"Doubly linked list\" width=\"900\" height=\"200\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Doubly-linked-list.jpg 900w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Doubly-linked-list-150x33.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Doubly-linked-list-300x67.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Doubly-linked-list-768x171.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Doubly-linked-list-520x116.jpg 520w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/a><\/p>\n<h4>3. Circular Linked List<\/h4>\n<p>In this Java Linked List, all the nodes align to form a circle, and also there is no NULL at the end, which helps us to define any node as the first and also helps to implement a circular queue.<\/p>\n<p>In this linked list, the last node connects back to the first node. That means the last node has the reference address of the first node, which denotes the circular working of the linked list.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Circular-Linked-List.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-69148\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Circular-Linked-List.jpg\" alt=\"Circular Linked List\" width=\"800\" height=\"200\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Circular-Linked-List.jpg 800w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Circular-Linked-List-150x38.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Circular-Linked-List-300x75.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Circular-Linked-List-768x192.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Circular-Linked-List-520x130.jpg 520w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<ul>\n<li><strong> Accessing time of an element:<\/strong> O(n)<\/li>\n<li><strong>Search time of an element:<\/strong> O(n)<\/li>\n<li><strong>Insertion of an Element:<\/strong> O(1) [If we are at the position where we have to insert an element]<\/li>\n<li><strong>Deletion of an Element:<\/strong> O(1) [If we know the address of the node previous to the node to be deleted]<\/li>\n<\/ul>\n<p><strong>Example \u2013<\/strong><\/p>\n<p>Consider the last example (Circular Linked List), where we need to add the marks of the students and a new subject is added to the list. We cannot add this to an array as the size is already fixed, and if we make a larger array, there will be empty spaces left. So, to overcome this drawback, we use linked lists.<\/p>\n<ul>\n<li>The only drawback is that we cannot randomly access the nodes, which was quite easy in arrays.<\/li>\n<\/ul>\n<p><em><strong>Are you still confused about the<a href=\"https:\/\/data-flair.training\/blogs\/core-java-vs-advanced-java\/\"> difference between Core Java and Advanced Java<\/a>? Check this Out!!\u00a0<\/strong><\/em><\/p>\n<h3>Java Stack<\/h3>\n<p>It is one of the best linear data structures in Java, runs on the principle of<span style=\"color: #000000\"><em><strong> Last In, First Out (LIFO)<\/strong><\/em><\/span>. It allows the user to have two operations, viz., Push and Pop. Push allows us to add elements, while Pop allows us to remove the last element. Both operations can take place at the same end.<\/p>\n<ul>\n<li><strong>Insertion:<\/strong> O(1)<\/li>\n<li><strong>Deletion:<\/strong> O(1)<\/li>\n<li><strong>Access Time:<\/strong> O(n) [Worst Case]<\/li>\n<li>It allows Insertion and Deletion on only one end.<\/li>\n<\/ul>\n<p><strong>Example &#8211;<\/strong> Stacks in Java are utilized for keeping up work calls (the last called work must complete execution first); we can simply eliminate recursion with the assistance of stacks. Stack data Structures in Java are additionally utilized in situations where we need to reverse a word, check for an adjusted bracket, and in editors where the word you wrote last is the first to be removed when you utilize the fix activity. Correspondingly, to execute back usefulness in web programs.<\/p>\n<h3>Java Queue<\/h3>\n<p>A Queue is a linear <a href=\"https:\/\/en.wikipedia.org\/wiki\/Data_structure\">data structures<\/a> in Java that offers the option<span style=\"color: #000000\"> <em><strong>First In, First Out (FIFO)<\/strong><\/em>, <\/span>which helps us to save a collection of data. It is an abstract data type. It provides two major options: enqueue, the way of adding a component to the collection. The component is included from the backside and dequeued, the way toward expelling the principal component that was included. The component is expelled from the front side. It can be actualized by utilizing both an exhibit and a connected rundown.<\/p>\n<ul>\n<li><strong>Insertion:<\/strong> O(1)<\/li>\n<li><strong>Deletion:<\/strong> O(1)<\/li>\n<li><strong>Access Time:<\/strong> O(n) [Worst Case]<\/li>\n<\/ul>\n<p><em><strong>Recommended Reading &#8211; <a href=\"https:\/\/data-flair.training\/blogs\/garbage-collection-in-java\/\">Garbage Collection in Java<\/a><\/strong><\/em><\/p>\n<p><strong>Example &#8211;<\/strong>\u00a0 Queue in Java, as the name says, is an information structure worked by the lines of transport stop or prepare where the individual who is remaining in the front of the queue(standing for a very long time) is the first to get the ticket. So any circumstance where assets are shared among various clients and served on first start things out server premise. Cases incorporate CPU planning and disk scheduling. Another utilization of a queue is when information is exchanged non-concurrently (information did not really arrive at the same rate as sent) between two processes. Illustrations incorporate IO Buffers, channels, document IO, and so on.<\/p>\n<h4>1. Circular Queue<\/h4>\n<p>The upside of this Linear data structures in Java is that it diminishes wastage of room in the event of cluster execution, as the inclusion of the (n+1)&#8217;th component is done at the 0&#8217;th record on the off chance that it is vacant.<\/p>\n<h3>Summary<\/h3>\n<p>Data structures are used to organize the data, which will be used productively in the future. In the above article, we discuss some important linear data structures with their implementation and examples. Hope you like the explanation.<\/p>\n<p>Feedback and suggestions are always welcome in the comment section.<\/p>\n<p style=\"text-align: center\"><em><strong><span style=\"color: #993300\">If you think Data Structure topic is over? So, you are WRONG, Learn the advanced concept &#8211;\u00a0<a href=\"https:\/\/data-flair.training\/blogs\/hierarchical-data-structure\/\">Hierarchical Data Structures in Java<\/a>\u00a0\u00a0<\/span><\/strong><\/em><\/p>\n<p><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:2017,&quot;href&quot;:&quot;https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Data_structure&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251011133658\\\/https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Data_structure&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-10 20:49:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-14 07:46:31&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-18 06:23:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-22 06:46:47&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-30 04:22:19&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-05 05:01:32&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-09 17:11:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-13 21:36:22&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-30 01:12:31&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-02 11:18:28&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-10 18:32:46&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-16 19:46:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-23 04:45:54&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-26 19:01:09&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-02 06:31:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-06 06:26:09&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-10 13:26:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-16 06:41:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-20 00:57:30&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-25 19:36:42&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-02 22:08:04&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-08 00:56:35&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-11 16:12:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-16 14:40:49&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-04-21 22:15:35&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-02 19:49:46&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-11 16:14:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-15 04:38:16&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-19 03:23:26&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-05 08:07:41&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-11 00:24:55&quot;,&quot;http_code&quot;:404}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-11 00:24:55&quot;,&quot;http_code&quot;:404},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linear data structures in Java are a way to organize the data in the language in a particular way so as to use them in the most effective way. The main reason to classify&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":69447,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[3469,4385,7381,7581,7656,7693,8284,8301,15073],"class_list":["post-9366","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-data-structures-in-java","tag-examples-of-data-structures","tag-java-array-example","tag-java-linked-list-example","tag-java-queue-examples","tag-java-stack-in-data-structure","tag-linear-data-structure","tag-linked-list-in-data-structure","tag-types-of-java-linked-lists-in-data-structure"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Linear Data Structures in Java - Array, Linked list, Stacks, and Queues - DataFlair<\/title>\n<meta name=\"description\" content=\"Linear Data Structure in Java is used to organize Data for better future use. Learn 4 types of data strcutures, Array, Linked List, Stacks, and Queue with examples\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linear Data Structures in Java - Array, Linked list, Stacks, and Queues - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Linear Data Structure in Java is used to organize Data for better future use. Learn 4 types of data strcutures, Array, Linked List, Stacks, and Queue with examples\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-01T08:06:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-28T09:53:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure.png\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linear Data Structures in Java - Array, Linked list, Stacks, and Queues - DataFlair","description":"Linear Data Structure in Java is used to organize Data for better future use. Learn 4 types of data strcutures, Array, Linked List, Stacks, and Queue with examples","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:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/","og_locale":"en_US","og_type":"article","og_title":"Linear Data Structures in Java - Array, Linked list, Stacks, and Queues - DataFlair","og_description":"Linear Data Structure in Java is used to organize Data for better future use. Learn 4 types of data strcutures, Array, Linked List, Stacks, and Queue with examples","og_url":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-03-01T08:06:05+00:00","article_modified_time":"2026-05-28T09:53:19+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure.png","type":"image\/png"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Linear Data Structures in Java &#8211; Array, Linked list, Stacks, and Queues","datePublished":"2018-03-01T08:06:05+00:00","dateModified":"2026-05-28T09:53:19+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/"},"wordCount":1136,"commentCount":4,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure.png","keywords":["Data Structures in Java","examples of Data structures","java array example","Java Linked list example","Java queue examples","Java stack in Data Structure","Linear Data Structure","linked list in Data Structure","Types of Java linked lists in Data Structure"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/","url":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/","name":"Linear Data Structures in Java - Array, Linked list, Stacks, and Queues - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure.png","datePublished":"2018-03-01T08:06:05+00:00","dateModified":"2026-05-28T09:53:19+00:00","description":"Linear Data Structure in Java is used to organize Data for better future use. Learn 4 types of data strcutures, Array, Linked List, Stacks, and Queue with examples","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Linear-data-structure.png","width":802,"height":420,"caption":"Linear Data Structure in Java with Example"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/linear-data-structures-in-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Java Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/java\/"},{"@type":"ListItem","position":3,"name":"Linear Data Structures in Java &#8211; Array, Linked list, Stacks, and Queues"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/9366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=9366"}],"version-history":[{"count":10,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/9366\/revisions"}],"predecessor-version":[{"id":148461,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/9366\/revisions\/148461"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/69447"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=9366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=9366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=9366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}