Escolar Documentos
Profissional Documentos
Cultura Documentos
Declaration:
I declare that this assignment is my individual work. I have not copied from any
other student’s work or from any other source except where due acknowledgment
is made explicitly in the text, nor has been written for me another person.
Student’s signature: DEEPAK PANWAR
Evaluator’s comments:
Marks obtained _____________________ out of
______________________________
Content of home work should start from this page only:
ASSIGNMENT - 1
Q1
ANS:-
There are several eg. of Abstract data types and stack and
queues are common among those. The basic operation of stack
and queue are as shown below.
1
2
3
QUEUE ENQUEUE AND DEQUEUE
3 2 1
FRONT REAR
Note that each of above ADTs has two parts (a) a particular data
structure and (b) operations applied on the data structure. We call
these data type abstract because we have said nothing about
how they are implemented.
Q3
ANS:-Data structure are used in various diverse field of computer
science, such as :
Operation System
Graphic
Artificial intelligence
Network Analysis
Numerical Analysis
Computer Design
Simulation
Q4
ANS:-
Eg. Void matrixmul(int A[] [], int B[] [], int C[] [], int n, int m)
For(int i=1;i<=n;i++)
{C[i] [j]=0;
{ C[i][j]+=A[i][k]*B[k][j];
} return 0;
2+3n+4n2+3n3
Q5
[end of loop]
3. RETURN
1. I N[Initialize Counter]
7. EXIT
SUM= SUM+TEST[ J ].
4. AVG=SUM / 30.
5. EXIT.
Q7ANS:-I
1) SUM 0,a[k]0
7) TEMPA[J]
8) A[J]A[J+1]
9) A[J+1]TEMP
10) Return
11) Repeat Steps 6 for I=1 to 5
12) sum=sum+A[I]
13) average=sum/5
14) if(average>=60)then
gradeA
15) Exit
Q8ANS:- SOLUTION
1. SUM 0
4. Sum=sum+a[j]
5. average=sum/6;
6.if(average>=60)then
Gradepass
Else
Gradefail
count++
7.Return
Q9 ANS:- solution
1. SUM 0
4. Sum=sum+a[j]
5. Percentagesum/6
6. A[i]=percentage
8. Sum=sum+A[i]
9. avgerage=sum/30
10. if(average>=60)then
GradeA
Else
GradeB
10. Return