Data Structure Questions Set-1
1.
(a) What is a Data structure? What are various
types of Data structures with their applications?
Ans. A Data type refers to a named group of data which share
similar properties or characteristics and which have common behavior among
them. Three fundamental data types used
in C programming are int for integer values, float for floating-point numbers and
char for character values.
But,
sometimes a need arises to treat a group of different data types as a single
unit. For example, a record in a file can have several fields of different data
types and entire record may be required to be processed in one unit. In such a
case, Data structures can be beneficial as data structures let you combine data
of different types and process them together.
Def : A Data structure is a named group of data of different
data types which can be processed as a single unit.
Data structure is a representation of the logical
relationship existing between individual elements of data. In other words, a
Data structure is a way of organizing all data items that considers not only
the elements stored but also their relationship to each other.
CLASSIFICATION OF DATA STRUCTURES :
Data structures are normally divided into two broad
categories.
(i) Primitive
Data Structures.
(ii) Non-Primitive
Data Structures.
(1) Primitive Data Structures (Built-In) :
These are basic structures and are directly operated upon by
the machine instructions. These, in general, have different representations on
different computers. Integers, floating-point numbers, character constants,
string constants, pointers etc. fall in this category.
(2) Non-Primitive Data Structures (User-Defined) :
These are more complicated data structures. These are
derived from the primitive data structures. The non-primitive data structures
emphasize on structuring of a group of homogeneous (same type) or heterogeneous
(different type) data items. Arrays, structures, lists and files are examples.
The data
appearing in our data structures are processed by means of certain operations.
In fact, the particular data structure that one chooses for a given situation
depends largely on the frequency with which specific operations are performed.
No comments:
Post a Comment