A Data Structure Is A Particular Way of Storing and Organizing Data in A Computer So That It Can Be Used Efficiently
A Data Structure Is A Particular Way of Storing and Organizing Data in A Computer So That It Can Be Used Efficiently
used efficiently.
What is Data?
Data is information processed or stored by a computer.
This information may be in the form of text documents, images, audio clips, software programs,
or other types of data.
Computer data may be processed by the computer's CPU and is stored in files and folders on the
computer's hard disk.
Adt:
An abstract data type is a type with associated operations, but whose representation is hidden.
Abstract data types or ADTs are a mathematical specification of a set of data and the set of
operations that can be performed on the data
Que;
Real life examples
Waiting in line
Waiting on hold for tech support
Applications related to Computer Science
Threads
Job scheduling (e.g. Round-Robin algorithm for CPU allocation)
Poly:
A polynomial can be represented in an array or in a linked list by simply storing the coefficient
and exponent of each term. However, for any polynomial operation , such as addition
or multiplication of polynomials , you will find that the linked list representation is more easier
to deal with. First of all note that in a polynomial all the terms may not be present, especially if it
is going to be a very high order polynomial. Consider
5 x12 + 2 x9 + 4x7 + 6x5 + x2 + 12 x
Now this 12th order polynomial does not have all the 13 terms (including the constant term).
It would be very easy to represent the polynomial using a linked list structure, where each node
can hold information pertaining to a single term of the polynomial.
Each node will need to store
the variable x,
the exponent and
the coefficient for each term.
It often does not matter whether the polynomial is in x or y.
This information may not be very crucial for the intended
operations on the polynomial. Thus we need to define a node structure to hold two
integers , viz. exp and coff
Compare this representation with storing the same polynomial using an array structure.
In the array we have to have keep a slot for each exponent
of x,
thus if we have a polynomial of order 50 but containing
just 6 terms, then a large number of entries will be zero in
the array.
You will also see that it would be also easy to manipulate a
pair of polynomials if they are represented using linked
lists.
Addition of two polynomials
Consider addition of the following polynomials
5 x12 + 2 x9 + 4x7 + 6x6 + x3
7 x8 + 2 x7 + 8x6 + 6x4 + 2x2 + 3 x + 40
The resulting polynomial is going to be
5 x12 + 2 x9 + 7 x8 + 6 x7 + 14x6 + 6x4 +x3