Data Structure & Algorithm
Data Structure & Algorithm
A. Cells
B. Fields
C. Arrays
D. Records
a. Explain various data structures with example.
b. List primitive and non-primitive data structure with example
c. What is data structure? What are the common operations performed on data
structure. Also explain types of data structure with their example.
d. Define the following term. (i) Array (ii) Field (iii) Cell (iv) Record
e. Explain row-major order of storage for an array.
f. Explain “Insertion and deletion operations are difficult and time consuming with
array”.
g. Define array and structure.
h. State the difference between a class and a structure.
Data Structure
Data may be organized in many different ways; the logical model of a particular
organization of data is called data structure. Data structure is a collection of data
elements whose organization is characterized by assessing operation that are
used to store and retrieve the individual data elements.
Alternative definitions: The different models used to organize data in the main
memory are collectively referred as data structures.
Cell: The smallest fundamental structural unit which represents a data entity.
Fields: A field can be considered to be the smallest piece of information that can
be referenced in programming language.
………………………………………………………………………………………………
LDRP Institute of Technology and Research A.B.Patel
1 of 4 of Module 1
CE 504 DATA STRUCTURE & ALGORITHM
type, i.e. integers, real or string etc. The individual elements of the array are
accessed by an index or indices to the array.
Structures:
A structure is a collection of fields in which the fields may be same or of different
types. A structure declaration forms a template that can be used to create
structures. The fields that make up the structure are called members of structure.
• Array: This is simplest type of data structure. By linear data structure, we mean
a list of finite number n of similar data elements referenced, respectively by a set
of n consecutive numbers, usually 1,2,3, …, n If we choose name V for an array,
then the elements of V are denoted as follows. V[1], V[2], V[3], … ,V[n]
• Linked List: A linked list can be defined as collection of nodes. A node has two
fields; information field and address field (link) that contains address of next
node. Following figure shows diagrammatical representation of linked list.
………………………………………………………………………………………………
LDRP Institute of Technology and Research A.B.Patel
2 of 4 of Module 1
CE 504 DATA STRUCTURE & ALGORITHM
• Stacks: A stack, also called last-in first-out (LIFO) system, is a linear list in
which insertion and deletion can take place at one end the TOP. This structure is
similar in its operation to a stack of dishes on a peg system.
• Queues: A queue, also called first-in first-out (FIFO) system, is a linear list, in
which insertion can take place at one end, FRONT, and deletion can take place
at other end, REAR of the list. A line of people waiting for railway reservation
system is an example of queue.
………………………………………………………………………………………………
LDRP Institute of Technology and Research A.B.Patel
3 of 4 of Module 1
CE 504 DATA STRUCTURE & ALGORITHM
Using this base address, the computer computes the address of the elements in
the ith row and jth column i.e. loc(a[i][j]), using the following formula.
………………………………………………………………………………………………
LDRP Institute of Technology and Research A.B.Patel
4 of 4 of Module 1