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
Class notes

Principle of programming languages

Rating
-
Sold
-
Pages
5
Uploaded on
15-03-2023
Written in
2022/2023

Providing indepth notes to important topic.

Institution
Course

Content preview

ELEMENTARY DATA TYPES
An elementary data object includes a single data value and a class of elementary data objects
with a set of operations for creating and manipulating them is represented as an elementary
data type. An example of elementary data types such as integer, real, character, Boolean,
pointer, etc.
The basic components of elementary data types are as follows −
 Attributes − Attributes refers to characteristics or group of characteristics that distinguish
one data object from others. The main attributes of a data object are its name, associated
address, and data type. The following declaration in C.
int a;
It specifies that a data object named ‘a’ is of type integer. The attributes of a data object can be
stored in a collection of memory cells, called descriptor (or dope vector). A descriptor is the
group of attributes of a variable. If the attributes are all fixed, descriptors are needed only at
compile time. They are developed by the compiler, generally as a part of the symbol table, and
are used during compilation.
 Values − It refers to a set of all possible values that a data object can contain. The values
that a data object can assume are determined by the type of that data object. An
elementary data object contains a single value from the set of values at any point during
its lifetime. For example, the C declaration int a; specifies that the data object a can
assume a single integer value from a set of integer values. The value included in a data
object can change during the lifetime of the data object and is therefore represented
explicitly during the program execution.
 Operations − An operation refers to a mathematical function for the manipulation of data
objects. An operation includes −
o Domain − It refers to a set of all possible input arguments on which the operation is
defined.
o Range − It refers to a set of all possible results that an operation can produce as an
output.
o Action − The action of the operation represents the result created for any given set
of arguments.
o Algorithm − It defines how to evaluate the results for any given set of arguments. It
is used for determining the action of an operation.
o Signature − A signature of an operator defines the number, order, and data types of
the arguments in the domain of an operation and the order and data type of the
producing order.

, Structured Data Types
A structured type is a user-defined data type containing one or more named attributes, each of
which has a data type. Attributes are properties that describe an instance of a type.

A geometric shape, for example, might have attributes such as its list of Cartesian coordinates.
A person might have attributes of name, address, and so on. A department might have
attributes of a name or some other kind of ID.

A structured type also includes a set of method specifications. Methods enable you to define
behaviors for structured types. Like user-defined functions (UDFs), methods are routines that
extend SQL. In the case of methods, however, the behavior is integrated solely with a particular
structured type.

A structured type can be used as the type of a table, view, or column. When used as the type
for a table, that table is known as a typed table and when used as the type for a view, that view
is known as a typed view. For typed tables and typed views, the names and data types of the
attributes of the structured type become the names and data types of the columns of the typed
table or typed view. Rows of the typed table or typed view can be thought of as a
representation of instances of the structured type.

A type cannot be dropped when certain other objects use the type, either directly or indirectly.
For example, a type cannot be dropped if a table or view column makes a direct or indirect use
of the type.




Abstract Data Types:
Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of
values and a set of operations. The definition of ADT only mentions what operations are to be
performed but not how these operations will be implemented. It does not specify how data will be
organized in memory and what algorithms will be used for implementing the operations. It is called
“abstract” because it gives an implementation-independent view.
The process of providing only the essentials and hiding the details is known as abstraction.
The user of data type does not need to know how that data type is implemented, for example, we
have been using Primitive values like int, float, char data types only with the knowledge that these
data type can operate and be performed on without any idea of how they are implemented.
So a user only needs to know what a data type can do, but not how it will be implemented. Think
of ADT as a black box which hides the inner structure and design of the data type. Now we’ll
define three ADTs namely List ADT, Stack ADT, Queue ADT.
1. List ADT
 The data is generally stored in key sequence in a list which has a head structure consisting
of count, pointers and address of compare function needed to compare the data in the list.

Written for

Course

Document information

Uploaded on
March 15, 2023
Number of pages
5
Written in
2022/2023
Type
Class notes
Professor(s)
Unknown
Contains
All classes

Subjects

$8.49
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
siddhantbhatt

Get to know the seller

Seller avatar
siddhantbhatt Aakash
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
4
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