Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary programming

Rating
-
Sold
-
Pages
12
Uploaded on
03-07-2023
Written in
2022/2023

Summary of 12 pages for the course bca at bca (DSA)

Institution
Course

Content preview

Primitive vs non-primitive data structure
Data structure means organizing the data in the memory. The data can be organized in two
ways either linear or non-linear way.

There are two types of data structure available for the programming purpose:

● Primitive data structure
● Non-primitive data structure

Primitive data structure is a fundamental type of data structure that stores the data of only
one type whereas the non-primitive data structure is a type of data structure which is a
user-defined that stores the data of different types in a single entity.




In the above image, we can observe the classification of the data structure. The data
structure is classified into two types, i.e., primitive and non-primitive data structure. In the
case of primitive data structure, it contains fundamental data types such as integer, float,
character, pointer, and these fundamental data types can hold a single type of value. For
example, integer variable can hold integer type of value, float variable can hold floating type
of value, character variable can hold character type of value whereas the pointer variable
can hold pointer type of value.

In the case of non-primitive data structure, it is categorized into two parts such as linear data
structure and non-linear data structure. Linear data structure is a sequential type of data
structure, and here sequential means that all the elements in the memory are stored in a
sequential manner; for example, element stored after the second element would be the third
element, the element stored after the third element would be the fourth element and so on.

, We have different linear data structures holding the sequential values such as Array, Linked
list, Stack, Queue.

Non-linear data structure is a kind of random type of data structure. The non-linear data
structures are Tree and Graph.

Let's understand the differences between the primitive and non-primitive data
structure.



Primitive data structure Non-primitive data structure

Primitive data structure is a kind of data Non-primitive data structure is a type of data
structure that stores the data of only one structure that can store the data of more than
type. one type.

Examples of primitive data structure are Examples of non-primitive data structure are
integer, character, float. Array, Linked list, stack.

Primitive data structure will contain some Non-primitive data structure can consist of a
value, i.e., it cannot be NULL. NULL value.

The size depends on the type of the data In case of non-primitive data structure, size is
structure. not fixed.

It starts with a lowercase character. It starts with an uppercase character.

Primitive data structure can be used to Non-primitive data structure cannot be used to
call the methods. call the methods.


Primitive data structure

Primitive data structure is a data structure that can hold a single value in a specific location
whereas the non-linear data structure can hold multiple values either in a contiguous location
or random locations

The examples of primitive data structure are float, character, integer and pointer. The value
to the primitive data structure is provided by the programmer. The following are the four
primitive data structures:

● Integer: The integer data type contains the numeric values. It contains the whole
numbers that can be either negative or positive. When the range of integer data type
is not large enough then in that case, we can use long.
● Float: The float is a data type that can hold decimal values. When the precision of
decimal value increases then the Double data type is used.
● Boolean: It is a data type that can hold either a True or a False value. It is mainly
used for checking the condition.
● Character: It is a data type that can hold a single character value both uppercase
and lowercase such as 'A' or 'a'.

Written for

Course

Document information

Uploaded on
July 3, 2023
Number of pages
12
Written in
2022/2023
Type
SUMMARY

Subjects

$8.29
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
yashsoni1

Get to know the seller

Seller avatar
yashsoni1 DDPS
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
5
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions