Here are the key explanation of Data types, Data Structure and Abstract data type(ADT)
Data refers to basic facts and figures. It is a raw information that simply includes basic numbers or texts.
• In computers, it may be in the form of different types of files, such as images, text, graphics, and videos.
Data Types:
A data type is an attribute associated with a piece of data that tells a computer system how to interpret its value.
• They specify the different sizes and values that can be stored in the variable.
There are two types of data types in Java:
- .Primitive data types: The primitive data types include Boolean, char, byte, short, int, long, float and double.
- Non-primitive data types: The non-primitive data types include classes, interfaces and arrays
Data Structure:
Organized collection of data in particular format is called data structure.
• It is a technique or method of study how the data are interrelated to each other logically or mathematically.
• The main objective of data structure is to increase the efficiency of programs and decrease the storage requirement.
Explanation:
- Linear Data Structures:
- Arrays: Contiguous memory locations used to store elements of the same data type.
- Linked Lists: Elements are stored in nodes, where each node contains a data field and a reference to the next node.
- Stacks: Follows the Last In, First Out (LIFO) principle, where elements are inserted and removed from the same end.
- Queues: Follows the First In, First Out (FIFO) principle, where elements are inserted at the rear and removed from the front.
- Non-linear Data Structures:
- Trees: Hierarchical data structures consisting of nodes connected by edges, with a single root node and child nodes.
- Binary Trees: Each node has at most two children, typically called the left child and the right child.
- Binary Search Trees (BST): A type of binary tree where the left child is less than the parent, and the right child is greater.
- Trees: Hierarchical data structures consisting of nodes connected by edges, with a single root node and child nodes.
3.Static vs. Dynamic Data Structures:
- Static Data Structures: Size and structure are fixed at compile-time and cannot be modified during program execution.
- Dynamic Data Structures: Size and structure can be modified dynamically during program execution.
Abstract Data Type (ADT):
- ADT is a blueprint for creating a data structure that defines the behavior and interface of the structure, without specifying how it is implemented.
- An ADT in the data structure can be thought of as a set of operations that can be performed on a set of values. This set of operations actually defines the behavior of the data structure, and they are used to manipulate the data in a way that suits the needs of the program.