Understanding Basic Data Structures Using Python
Make Your Programming Base More Strong By Adding The Power of data structures
Published in
7 min readJan 25, 2021
Data Structures helps you to solve complex problems in a simpler way with minimum time spent. In this blog, we will discuss all the basic data structures with the programming explanation of them.
1. Array
An array is like a container where you can store any number of items of the same type. For example, an array of integers or characters.
Examples
arr1 = [1,2,3,4,5] ✔
arr2 = [1,2.5,3,4,5.5] ✖
arr3 = ['a','b','c','d'] ✔
arr4 = ['a',1,'b',4] ✖
There are mainly five operations we can perform in an array.
- Insertion: Insertion means adding new elements into an array. We can insert an element at three positions in an array — at the start, at the end, and at a particular position.
- Deletion: Deletion means deleting an element from the array.
- Update: Updating means updating an element with another element.
- Traverse: Printing or showing all the elements.
- Searching: Checking for the occurrence of a given element in the array.