Assignment DS
Assignment DS
and the fundamental operations supported on them. An ADT promotes data abstraction and
focuses on what a data structure does, rather than how it implements (does). An ADT is a
conceptual model of information structure. An ADT specifies the components, their
structuring relationships and a list of operations that are allowed to perform. It is just a
specification, no design or implementation information is included. Specification involves
the ―what‖ the operations, not the ―how‖. ADT‘s are generalizations of primitive data
types. A data structure is the design representation of an ADT. The same ADT may be
represented by several data structures. There are many data structures corresponding to
the ADT ―set
1.
.In a linear data structure, data elements In a non-linear data structure, data
are arranged in a linear order where each elements are attached in hierarchically
and every elements are attached to its manner.
previous and next adjacent
. In linear data structure, single level is
involved. . Whereas in non-linear data structure,
. In linear data structure, data elements multiple levels are involved.
can be traversed in a single run only. . While in non-linear data structure, data
elements can’t be traversed in a single run
. In a linear data structure, memory is not only.
utilized in an efficient way. . While in a non-linear data structure,
. Its examples are: array, stack, queue, memory is utilized in an efficient way.
linked list, etc. . While its examples are: trees and graphs.
2. Operation Description
Creation: Allocation of memory for the data structure, the creation of data structure may take
place either during compile-time or during run-time.
Traversing :Accessing and processing each data item of the data structure exactly once.
Searching :Find the location of the key value within the data structure.
Sorting: Arranging all the data items in a data structure either in ascending or in descending
order or in lexicographical order (for Strings).
Merging :Combining the data items of two different sorted lists into a single sorted list.
3. Definition: A matrix is said to be Sparse Matrix if most of its elements are zero (near more
than 2/3 elements are zero), having a relatively small number of non-zero elements. A
matrix that is not sparse is called Dense Matrix. A sparse matrix is a two-dimensional array in
which most of the elements have a null value or zero. However, for sparse matrices, this
invokes wastage of a lot of memory space.