Ds Mod1
Ds Mod1
Ds Mod1
CO-PO MAPPING
Department of Master of Computer Applications
Bangalore Institute of Technology
Presentation on Awareness of
Outcome Based Education (OBE)
and
National Board of Accreditation(NBA)
Overview
1. National Board of Accreditation (NBA)
2. Bloom’s Taxonomy of Learning
3. Outcome Based Education (OBE)
4. Vision and Mission of the Institute
5. Vision and Mission of the Department
6. Program Educational Objectives (PEO’s)
7. Program Outcomes (PO’s)
8. Course Learning Objectives (CLO’s)
5
Bloom’s Taxonomy of Learning
Teaching with
the Revised Bloom's
Taxonomy
6
Bloom’s Taxonomy of Learning
Taxonomy = Classification
Classification of thinking
7
Original Terms New
Terms
•Creating
• Evaluation
• Synthesis •Evaluating
• Analysis
•Analysing
• Application
•Applying
• Comprehension •Understanding
• Knowledge
•Remembering
8
What Is Outcome Based Education?
NO OBE = NO ACCREDITATION
11
Study Program and Professional:
• Knowledge, skill
Accreditation Program
• Competence
Educational
• Self Development
Objectives
• Responsibility
Curriculu • Ethics
m
Governance
& Financial Faculty
3-5 yrs
Std. Teaching,
Support Learning
Graduates with
ability in:
Facilities
• Specific knowledge
Program
• Design
Outcomes
• Communication
• Teamwork
• Management
• Life long learning
Vision and Mission of the Institute
Types: Singly Linked List. Linked list as a data Structure, Inserting and
removing nodes from a list, Linked implementations of stacks, Header
nodes, Array implementation of lists.
Lab Syllabus
MODULE 3
6.
Write a C program to simulate the working of a singly linked list
providing the following operations:
a. Display & Insert
b. Delete from the beginning/end
c. Delete a given element
Syllabus
MODULE 4
10. Find Minimum Cost Spanning Tree of a given undirected graph using
Kruskal's algorithm ( C programming)
Syllabus
Text Books:
1. Introduction to the Design and Analysis of Algorithms. AnanyLevitin, Pearson
Education, 2nd Edition.
CO1 3 3 3
CO2 3 3 3
CO3 3 3 3
Question Paper Pattern:
•
DATA STRUCTURES
DEFINITION:
OR
Primitive
The Primitive Data Structures are data
structures that can be manipulated directly by
machine instructions.
Ex: int, float, char, double.
Non-Primitive
Non-primitive data structures cannot be
manipulated directly by machine instructions.
Ex: linear and Non linear
Non primitive :
• Insertion / Creation
• Deletion
• Traversing
• Searching
• Sorting
• Merging.
ADT – Abstract Data Types
Definition ( ADT ) :
• ADT is a class of objects whose logical behavior is defined by a set
of values and set of operations.
• Data structure is an implementation of a ADT.
Possible values
Behavior
Functions/Modules
Operations
STACKS
Def:
A stack is a special type of data structure, where
elements are inserted from one end and elements are
deleted from the same end.
4 4
3 3 top12
2 2 05
1 1 15
0 0 24
top = -1
Inserting an element to stack : (push operation )
4 4 4 4
3 3 3 3
2 2 2 top 30 2
20 20
1 2 top 1 1
10 10 10
0 top 0 0 0
top=-1
4 top 50 4
40
top 3 40 3
30
2 30 2
20
1 20 1
10
0 10 0
Only one item is deleted from the stack and the item has
to be deleted only from top of the stack.
Deleting an element to stack : (pop operation )
top 50 4 4 4 4
40 3 top 40 3 3 3
30 2 30 2 top 30 2 2
20 20 20
20 1 2 1 top 1
10 10 10
10 0 0 0 0
4 4
3 3
2 2
1 1
10
top 0 0
top = -1
* If we try to delete one more element it results in a “ underflow of Stack”
// C function to delete an item from stack.
#include <stdio.h>
#include < process.h>
#define STACK_SIZE 5;
int top;
int s[10];
int item;
//function ---1
//function----2
//function----3
Void main()
{
int item;
int item_deleted;
int choice;
top = -1;
for( ; ; )
{
printf(“1. push, 2. pop, 3. Display, 4. Exit”);
printf(“enter the choice”);
Scanf(“%d”,&choice);
Switch(choice)
{
Case 1:
printf(“ Enter the item to be inserted”);
Scanf( “%d”, &item);
push();
break;
Case 2:
item_deleted = pop();
if (item_deleted == 0)
printf(“stack is empty”);
else
printf(“Item deleted= %d”, item_deleted);
break;
Case 3:
display();
break;
default:
exit(0);
}
}
}
Applications of stack:
1.Conversion of expressions
2. Evaluation of expressions
3.recursion
Conversion of expressions
Prefix Expression:
Postfix expression:
Infix expression:
Infix expression:
In an expression, if an operator is in the b/w two
operands, the expression is called an infix expression.
Ex: a+b, (a-b), (a+b*c-(d*f))
Postfix expression:
In an expression, if an operator follows the two
operands ( operator comes after the two operands ) , the
expression is called “postfix expression”. It is also called as
“Suffix expression”.
Ex: ab+, ab-, (a+b*c) ab*c+
Prefix Expression:
In an expression, if an operator precede the two
operands(i.e., operator comes before the two operands), the
expression is called “Prefix Expression”.
Ex: +ab, -ab….
Precedence and Associativity of the operator :
Ex : 6 * (2 + 3) – 5 6 * (2 + 3) – 5
6*5–5 6*5–5
30 – 5 6*0
25 0
The below table shows arithmetic operators along with
priority values,
Exponentiation $ 6
Multiplication * 4
Division / 4
Mod % 4
Addition + 2
Substraction - 2
Associativity of the operator :
T3E^F + T3 = AT2+
A T1 D * +E^F + T1 = BC-
ABC-D*+E^F+
(( A+(B-C)*D)^E+F) = ABC-D*+E^F+
2. X ^ Y ^ Z-M +N+P/Q
T2M-N+PQ/+ T2 = XT1^
XT1^M-N+PQ/+ T1 = YZ^
XYZ^^M-N+PQ/+
# # ABC-D*+
/* C function for stack precedence
int F (char symbol) //function 1
{
Switch (symbol)
{
Case ‘+’ :
Case ‘-‘ : return 2;
Case ‘*’ :
Case ‘/’ : return 4;
Case ‘^’ :
Case ‘$’ : return 5;
Case ‘(‘ : return 0;
Case ‘#’: return -1;
default : return 8;
}
}
/* C function for input precedence
int G (char symbol) //function 2
{
Switch (symbol)
{
Case ‘+’ :
Case ‘-’ : return 1;
Case ‘*’ :
Case ‘/’ : return 3;
Case ‘^’ :
Case ‘$’ : return 6;
Case ‘(’ : return 9;
Case ‘)’ : return 0;
default : return 7;
}
}
/* C function to convert from infix into postfix expression.
top=-1; Step : 1
S[++top]= ‘#’;
j=0;
postfix[j]=’\0’;
}
// C program to convert an infix expression to postfix
expression
# include < stdio.h>
# include < string.h >
/* include function 1, function 2, function 3. */
void main ()
{
char infix[20];
char postfix[20];
printf (“ Enter the valid infix expression”);
scanf (“ %s ”, infix );
infix_postfix ( infix, postfix);
printf (“ The postfix expression is “ );
printf (“%s”,postfix);
}
•To write a program by using stack data structure,
Let us use two precedence function F and G. The
function F contains the precedence values of symbols on top of
the stack and function G contains the precedence values of
symbols in the input string.
Shown in below table, ( infix to prefix )
top=-1; Step : 1
S[++top]= ‘#’;
j=0;
strrev ( infix );
for(i=0; I < strlen (infix); i++)
{
Symbol=infix[i];
/* if stack precedence greater , remove symbol from
stack and place into postfix. */
prefix[j]=’\0’;
strrev (prefix );
}
// C program to convert an infix expression to prefix expression
# include < stdio.h>
# include < string.h >
/* include function 1, function 2, function 3. */
void main ()
{
char infix[20];
char prefix[20];
printf (“ Enter the valid infix expression”);
scanf (“ %s ”, infix );
infix_prefix ( infix, prefix);
printf (“ The postfix expression is “ );
printf (“%s”, prefix);
}
Evaluation of postfix expression :
Algorithm:
Step 1 : Scan the symbol from left to right.
ABC-D*+E$F+ infix((A+(B-C)*D)$E+F)
Solution:
After substituting the values
632-5*+1$7+
Ex: Evaluate the following postfix expression.
632-5*+1$7+ 6 6
32-5*+1$7+ 3 63
2-5*+1$7+ 2 632
-5*+1$7+ - 2 3 3–2=1 61
5*+1$7+ 5 615
*+1$7+ * 5 1 1*5=5 65
+1$7+ + 5 6 6 + 5 = 11 11
1$7+ 1 11 1
$7+ $ 1 11 11 $ 1 = 11 11
7+ 7 11 7
+ + 7 11 11 + 7 = 18 18
// c program to evaluate the postfix expression:
#include < stdio.h >
#include < math.h >
#include < string.h >
double compute(char symbol, double op1, double op2)
{
switch ( symbol)
{
Case ‘+’ : return op1+op2;
Case ‘-’ : return op1-op2;
Case ‘*’ : return op1*op2;
Case ‘/’ : return op1/op2;
Case ‘$’:
Case ‘^’: return pow(op1,op2);
} }
void main()
{
double s[20] , res , op1 , op2 ;
int top, i ;
char postfix[20] , symbol ;
top = -1;
Printf(“ enter the postfix expression”);
Scanf(“%s”, postfix);
Symbol = postfix[i];
if ( isdigit(symbol))
S[top++]= symbol;
else
{
op2 = s[top--];
op1 = s[top--];
res = compute(symbol, op1,op2);
S[++top] = res;
}
}
res = s[top--];
printf(“ the result is %f\n”, res);
}
Ex; to check whether a give string is palindrome or not using
stack.
# include <stdio.h>
# include <string.h>