Classification and Categories of Data Structures PDF

Summary

This document provides an overview of data structures, their classification, and various types. It details primitive data structures, non-primitive data structures, linear data structures (e.g., arrays, linked lists, stacks, queues), and non-linear data structures (e.g., trees, graphs).

Full Transcript

Click to edit Master title style Classification and Categories of Data Structures 1 Click Data to edit Master title style Structures A Data Structure delivers a structured set of variables related to each other in var...

Click to edit Master title style Classification and Categories of Data Structures 1 Click Data to edit Master title style Structures A Data Structure delivers a structured set of variables related to each other in various ways. It signifies the relationship between data elements and allows efficient data processing. 2 2 Click to edit Master Classification title of Data style Structures Primitive Data Structures Non-Primitive Data Structures 3 3 Click to edit Primitive DataMaster title style Structures Numbers and the characters that come in-built into programs. These are basic built-in data types in Java. Byte: Stores whole numbers from -128 to 127. char: Stores individual characters. short: Stores whole numbers from -32,768 to boolean: Stores true or false values. 32,767. long: Stores large whole numbers. int: Stores whole numbers from -2,147,483,648 Double: Stores floating-factor numbers with to 2,147,483,647. double precision. float: Stores floating-point numbers with single precision. 4 4 Click to edit Master Non-Primitive title style Data Structures Cannot be directly manipulated by machine-level instructions. Focus on forming homogeneous or heterogeneous data elements. Sub-categories: Linear Non-Linear 5 5 Click Linearto Data edit Master title style Structures Preserves a linear connection among data elements, where each element consists of the successors and predecessors except the first and the last data element. Classified into Static and Dynamic Data Structures. 6 6 Click Staticto edit vs. MasterData Dynamic title Structures style Static Data Structures Dynamic Data Structures Data structures having a fixed size Data structures having a dynamic size Memory allocated at the compiled time allocated at the run time Their size cannot be changed after Their size varies during the run time of the compiled time code Their size and data elements can be changed However, the data stored in them can be at the run time altered. Examples: Linked Lists, Stacks, and Queues Example: Array 7 7 Click Typesto ofedit Master Linear Datatitle style Structures Arrays Linked Lists Collect multiple data elements of the same store a collection of data elements data type into one variable dynamically Each element has a unique place in the list Data elements are represented by the Nodes, Each element carries a different index number connected using links or pointers called a subscript Each node contains two fields, the information Data is stored in contiguous memory locations field and pointer field. the user can dynamically adjust the size of a Can traverse through the data elements of the Linked List as per the requirements. array using their respective indexes. 8 8 Click Typesto ofedit Master Linear Datatitle style Structures Stacks Queues follows the LIFO (Last In, First Out) principle Follows FIFO (First In, First Out) principle. Operations like insertion and deletion from the Insertion at one end, removal at the other. top. 9 9 Click to edit Data Non-Linear Master title style Structures Non-Linear Data Structures are data structures where the data elements are not arranged in sequential order. The insertion and removal of data are not feasible. There is hierarchical relationship between the individual data items. Types of Non-Linear Data Structures: 1. Trees 2. Graphs 10 10 Click to editData Non-Linear Master title style Structures Trees A Non-Linear Data Structure and a hierarchy containing a collection of nodes. A specialized method to arrange and collect data in the computer to be utilized more effectively. It contains a central node, structural nodes, and sub- nodes connected via edges. 11 11 Click to editData Non-Linear Master title style Structures Types of Trees  Binary Tree: Each node can have a maximum of two children linked to it (e.g., full binary trees, complete binary trees, balanced binary trees, and degenerate or pathological binary trees).  Ternary Tree: Each node has at most three child nodes, usually distinguished as “left”, “mid” and “right”.  N-ary Tree or Generic Tree: A collection of nodes where each node is a data structure that consists of records and a list of references to its children (duplicate references are not allowed). Unlike the linked list, each node stores the address of multiple nodes. 12 12 Click to editData Non-Linear Master title style Structures Graphs A Non-Linear Data Structure comprising a finite number of nodes or vertices and the edges connecting them. used to solve real-world problems by representing areas like social, circuit, and telephone networks as interconnected networks. A graph, G, is a mathematical structure consisting of a set of vertices, V, and a set of edges, E, represented as G = (V, E). 13 13 Click Basicto edit Master Operations of title Datastyle Structures Traversal: Access each data Merge: Combine two sorted lists into one element once sorted list. Search: Find data elements Create: Reserve memory for data meeting specific criteria elements during compile-time or run-time. Insertion: Add new data Selection: Choose particular data by elements specifying conditions. Deletion: Remove specific data Update: Modify data elements based on elements conditions. Sorting: Arrange data in Splitting: Divide data into subparts to ascending or descending order reduce processing time. 14 14

Use Quizgecko on...
Browser
Browser