Computer Science, Simply Explained.

Linear Data Structures, Part 1

⭐️️ amy ⭐️️
2 min readDec 4, 2017

Contents

A data structure is a way to organize information, or more literally, a way to structure data. A linear data structure is a data structure in which the information is stored sequentially. Meaning, you can scan through the data structure and each item has only one item directly before and after it.

Linear Data Structure with 6 items (also known as elements)
Not a linear data structure

There are a number of operations we can perform that allow us to access and use the data stored in a data structure.

  • Insertion: Add a new element to the data structure
  • Deletion: Remove an element from the data structure
  • Traversal: Scan through every element of the data structure
  • Search: Scan through the data (traversal) to find a specific element
  • Sort: Arrange the elements in a specific order
  • Merge: Combine two similar data structures into one

The different types of linear data structures that we will learn about have different methods, or algorithms, for performing these operations. We can choose the most efficient data structure based on how we want to use and access the data.

Take the example of the list of names of people waiting to check out a library book. We will only ever need to add a new name to the end of the list, because checking out library books is first come, first serve. The data structure we use won’t need to be as complex compared to the data structure we would need if we needed to add an item to a specific location in the list. Knowing what data structure fits the needs of the data best helps us find the quickest methods to access the data.

--

--