Types of Data Structure
* Primitive data structures
* Non-primitive data structures
Primitive Data Structures
Primitive Data Structures are the basic data structures that straightforwardly work upon the machine instructions.They have various representations on different computers. The term "data type" and "primitive data type" are commonly used interchangeably. This data types are predetermined types of data, which are supported by the programming language. For example, integer, character, float, string and pointer are all primitive data types. Programmers can utilize these data types when they creating variables in their programs. For example, a programmer may create a variable called "lastname" and define it as a string data type. The variable will then store data as a string of characters.
Types of Primitive Data Structure -
* Integer.
* Float.
* Char
* Pointer
Integer -
An integer is a absolute number (not a fraction) that can be positive, negative, or zero. Hence, the numbers 10, 0, -25, and 5,148 are all integers. Unlike floating point numbers, integers cannot have decimal places.
Integers are a often used data type in computer programming. For example, whenever a number is being incremented, such as within a "for loop" or "while loop," an integer is used. Integers are also used to allocate an item's location within an array.
Float -
Float is just opposite to Integer. Integer is a complete number not a decimal but Float is may be complete and decimal number also.It contains decimal numbers. For example, the numbers 5.5, 0.001, and -2,345.6789 are floating point numbers.
Character
A character is any letter, number, space, punctuation mark, or symbol that can be typed on a PC. The word "computer," for example, exits of eight characters. The phrase "Hi there." takes up nine characters. Each character requires one byte of space, so "PC" takes up 8 bytes.
The list of characters that can be composed is characterized by the ASCII and extended ASCII set.
Some of the symbols available are pretty strange and may even make you say, "That's quite a character!"
Pointer
Pointer is a variable, which include the address of another variable. If a variable contains address of another variable than it is said that first variable focuses to second. A pointer references a location in memory, and acquiring the value stored at that location is known as dereferencing the pointer.
Non-Primitive Data Structures
Non-primitive Data Types are not characterized by the programming language, yet are rather made by the programmer. They are sometimes called "reference variables," or "object references," since they reference a area, which stores the information. In the Java programming language, non-primitive data types are basically called "objects" because they are created, rather than predefined. While an object may contain any type of information, the information referenced by the object may still be stored as a primitive data type.
Types of Non-Primitive Data Structure -
* Array.
* List.
a) Linear List.
a.1) Stack.
a.2) Queue.
b) Non Linear List
b.1) Graph.
b.2) Tree.
* Files
Comments
Post a Comment