Main Data Structures
These are the Main Data Structures Arrays Stacks Queues Linked Lists Trees Graphs Hash Tables 1. Array An array is the simplest and most widely used data structure. Other data structures like stacks and queues are derived from arrays. Here’s an image of a simple array of size 4, containing elements (1, 2, 3 and 4). Each data element is assigned a positive numerical value called the Index , which corresponds to the position of that item in the array. The majority of languages define the starting index of the array as 0. The following are the two types of arrays: One-dimensional arrays (as shown above) Multi-dimensional arrays (arrays within arrays) Basic Operations Following are the basic operations supported by an array. Traverse − print all the array elements one by one. Insertion − Adds an element at the given index. Deletion − Deletes an element at the given index. Search − Searches an element using the given index or by the value. Update − Updates an e...