Different types of data structures


                The simplest type of data structure is a linear array. It means a list of finite number n of elements referenced respectively by a set of n consecutive numbers, usually 1,2,3,…,n. If we choose the name A for the array then the elements of A are denoted by subscript notation as a1, a2, a3,…, an , or by parenthesis notation A(1), A(2), A(3),…, A(n) or by bracket notation A[1], A[2], A[3],… ,A[n]. For example, considering the following array named STUDENTS containing 6 student names,
Here, STUDENTS[1] = Tanmay, STUDENTS[2] = H and so on.

Linked List

                        A  linked list is a data structure that consists of a sequence of data records such that in each record there is a field that contains a reference (that is, a link) to the next record in the sequence. In other words, A simple linear data structure, each of whose nodes includes pointers to the previous and subsequent nodes in the list, enabling traversal of the structure from any starting point. For example, considering following two lists.

These are list of patients and doctors indicating which patient met which doctors and which doctors saw which patient. For example, if we select Tanmay then the corresponding pointers are 1 and 3 and these are the index number of the Doctor list. Thus, Tanmay met S and N. Again if we select Sh from the Doctor list, it has 4,5 and 6 and these are the index of the patient list, thus Sh saw the patients B, C and D.


Data frequently contain a hierarchical relationship between various elements. The data structure which reflects this relationship is called a rooted tree graph or simply a tree. This is sometimes like the properties of an object. For example, properties to store of an employee in the office directory can be name, age, sex, salary etc. Again the properties “name” can have sub-properties like first name, middle name, last name etc. This can be showed as follows.


               A stack, also called a Last-In-First-Out (LIFO) system, where insertion and deletion can take place only at one end called the top. This structure is similar in its operation to stack of dishes in a spring system as in the following figure.




                  A queue, also called a First-In-First-Out (FIFO) system is a linear list where deletions will take place only at the front end and insertions will take place only at the rear end. In the following figure we can see a pipe with two ends, left end is the rear end and right end is the front end. We are inserting some balls and those balls can only be inserted from the rear and they can come out (deletions) from the front end.


Written by 

I am Sakthivel Madesh, a certified Salesforce Developer & Administrator working on Salesforce Technology since 2011. I am currently working in IBM Austraila as Sr. Salesforce Developer. I have worked on multiple technologies Like PHP, Java, Salesforce, I am very passionate about Salesforce and to earn 10 Salesforce Certification. I love Trailhead for learning Salesforce Skill and Become a Trailhead Ranger too. I Love to Learn & Share my Salesforce knowledge to Salesforce Learners/Beginner using My Blog and Salesforce Community.

Leave a Reply