0% found this document useful (0 votes)
50 views11 pages

3.3SEM - IPCC - DS - CS322I2R and Lab Programs

This document outlines a course on data structures for the third semester. It includes 40 lectures and 20 practical sessions over 4 credits. The course objectives are to explain fundamentals of data structures and their applications for programming, illustrate linear data structures like stacks, queues, lists, trees and graphs, and demonstrate sorting and searching algorithms. The course contents cover these topics over 5 modules, including introduction to data structures, stacks and queues, linked lists, trees, and graphs. There are 8 laboratory experiments involving implementing programs for array operations, stacks, queues, linked lists, polynomials, and graphs.

Uploaded by

sharath.ai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views11 pages

3.3SEM - IPCC - DS - CS322I2R and Lab Programs

This document outlines a course on data structures for the third semester. It includes 40 lectures and 20 practical sessions over 4 credits. The course objectives are to explain fundamentals of data structures and their applications for programming, illustrate linear data structures like stacks, queues, lists, trees and graphs, and demonstrate sorting and searching algorithms. The course contents cover these topics over 5 modules, including introduction to data structures, stacks and queues, linked lists, trees, and graphs. There are 8 laboratory experiments involving implementing programs for array operations, stacks, queues, linked lists, polynomials, and graphs.

Uploaded by

sharath.ai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

DATA STRUCTURES

(Effective from the Academic Year 2022 - 2023)


III SEMESTER
Course Code CS322I2R CIA Marks 50
Number of Contact Hours/Week (L: T: P: S) 3:0:2:0 SEE Marks 50
Total Hours of Pedagogy 40L + 20P Exam Hours 03
CREDITS – 4
COURSE PREREQUISITES:

 Fundamental knowledge of C programming basics.


COURSE OBJECTIVES:
 Explain fundamentals of data structures and their applications essential for programming/problem-solving.
 Illustrate linear representation of data structures: Stacks, Queues, Lists, Trees and Graph’s.
 Demonstrate sorting and searching algorithms.

 Find suitable data structure during application development/Problem Solving.


TEACHING - LEARNING STRATEGY:
These are some sample strategies, which course faculty members can incorporate in the Teaching Learning Process:

● Chalk and Talk Method/Blended Mode Method

● Power Point Presentation

● Expert Talk/Webinar/Seminar

● Video Streaming/Self-Study/Simulations

● Peer-to-Peer Activities

● Activity/Problem/Laboratory Based Learning

● Case Studies

● MOOC/NPTEL Courses
COURSE CONTENTS
MODULE - I
Introduction to Data Structures 8 Hours

Introduction: Data Structures, Classifications (Primitive & Non Primitive), Data structure Operations, Review
of Arrays, Structures. Pointers and Dynamic Memory Allocation Functions. Array Operations: Traversing,
inserting, deleting, searching, and sorting. Multidimensional Arrays, Polynomials and Sparse Matrices.
Strings: Basic Terminology, Storing, Operations and Pattern Matching algorithms.

MODULE - II
Stacks and Queues 8 Hours

Stacks: Definition, Stack Operations’, Arrays Representation of Stacks, Stacks using Dynamic Array’s, Stack
Applications: Polish notation, Infix to postfix conversion, evaluation of postfix expression.

Queues: Definition, Arrays Representation, Queue Operations’, Circular Queues, Circular queues using
Dynamic array’s, Dequeues, Priority Queues, A Mazing Problem. Multiple Stacks and Queues. Programming
Examples
MODULE - III
8 Hours
Linked Lists: Definition, Representation of linked lists in Memory. Linked list operations:
Traversing, Searching, Insertion, and Deletion. Doubly Linked lists, Circular linked lists, and
header linked lists.. Applications of Linked lists – Polynomials, Sparse matrix representation.
MODULE - IV
8 Hours
Trees: Introduction, Binary Trees, Binary Tree Traversal, Additional Binary Tree Operations’, Threaded
Binary Trees, Binary Search Trees: Definition, searching a BST, Insertion, Deletion, Joining and Splitting
Binary Search Trees - Definition, Insertion, Deletion, Traversal, Searching, Application of Trees-Evaluation
of Expression, Programming Examples
MODULE - V
8 Hours
Graphs: Definitions, Terminologies, Matrix and Adjacency List Representation of Graphs, Elementary
Graph operations, Traversal methods: Breadth First Search and Depth First Search. Sorting and Searching:
Insertion Sort, Radix sort, Address Calculation Sort.

Hashing: Hash Table organizations, Hashing Functions, Static and Dynamic Hashing.
COURSE OUTCOMES
Upon completion of this course, the students will be able to:
Bloom’s
CO
Course Outcome Description Taxonomy
No.
Level
CO1
CO2
CO3
CO4
CO5
LABORATORY COMPONENTS
Bloom’s
Exp. CO
Experiment Description Taxonomy
No. No.
Level
Design, Develop and Implement a menu driven Program in C for the following array
operations.

a. Creating an array of N Integer Elements.

1. b. Display of array Elements with Suitable Headings.

c. Inserting an Element (ELEM) at a given valid Position (POS).

d. Deleting an Element at a given valid Position (POS).

e. Exit. Support the program with functions for each of the above operations
Design, Develop and Implement a menu driven Program in C for the following
operations on STACK of Integers (Array Implementation of Stack with maximum size
MAX)

a. Push an Element on to Stack

2. b. Pop an Element from Stack

c. Demonstrate how Stack can be used to check Palindrome

d. Demonstrate Overflow and Underflow situations on Stack

e. Display the status of Stack f. Exit Support the program with appropriate functions for
each of the above operations
Design, Develop and Implement a menu driven Program in C for the following
operations on, Circular QUEUE of Characters (Array Implementation of Queue with
maximum size MAX)

a.Insert an Element on to Circular QUEUE.

3. b. Delete an Element from Circular QUEUE

c. Demonstrate Overflow and Underflow situations on Circular QUEUE

d. Display the status of Circular QUEUE

e. Exit. Support the program with appropriate functions for each of the above operations
Design, Develop and Implement a menu driven Program in C for the following
operations on Singly Linked List (SLL) of Student Data with the fields: USN, Name,
Programme, Sem, PhNo

a. Create a SLL of N Students Data by using front insertion.

4. b. Display the status of SLL and count the number of nodes in it.

c. Perform Insertion / Deletion at End of SLL.

d. Perform Insertion / Deletion at Front of SLL(Demonstration of stack).

e. Exit
Design, Develop and Implement a Program in C for the following operationson Singly
Circular Linked List (SCLL) with header nodes

a. Represent and Evaluate a Polynomial P(x,y,z) = 6x2 y 2 z-4yz5 +3x3 yz+2xy5 z-


5.
2xyz3

b. Find the sum of two polynomials POLY1(x,y,z) and POLY2(x,y,z) and store the
result in POLYSUM(x,y,z) Support the program with appropriate functions for each of
the above operations
6. Design, Develop and Implement a Program in C for the following operationson Singly
Circular Linked List (SCLL) with header nodes

a. Represent and Evaluate a Polynomial P(x,y,z) = 6x2 y 2 z-4yz5 +3x3 yz+2xy5 z-


2xyz3

b. Find the sum of two polynomials POLY1(x,y,z) and POLY2(x,y,z) and store the
result in POLYSUM(x,y,z) Support the program with appropriate functions for each of
the above operations
Design, Develop and Implement a Program in C for the following operations on
Graph(G) of Cities

7. a. Create a Graph of N cities using Adjacency Matrix.

b. Print all the nodes reachable from a given starting node in a digraph using DFS/BFS
method
Given a File of N employee records with a set K of Keys (4-digit) which uniquely
determine the records in file F. Assume that file F is maintained in memory by a Hash
Table (HT) of m memory locations with L as the set of memory addresses (2-digit) of
8. locations in HT. Let the keys in K and addresses in L are Integers. Design and develop a
Program in C that uses Hash function H: K →L as H(K)=K mod m (remainder
method), and implement hashing technique to map a given key K to the address space
L. Resolve the collision (if any) using linear probing
CO-PO-PSO MAPPING
Programme
CO Programme Outcomes (PO) Specific
No. Outcome (PSO)
1 2 3 4 5 6 7 8 9 10 11 12 1 2
CO1
CO2
CO3
CO4
CO5
3: Substantial (High) 2: Moderate (Medium) 1: Poor (Low)

ASSESSMENT STRATEGY

Assessment will be both CIA and SEE. Students learning will be assessed using Direct and Indirect methods:
Sl. No. Assessment Description Weightage (%) Max. Marks
1 Continuous Internal Assessment (CIA) 100 % 50
Continuous Internal Evaluation (CIE) 60 % 30
Practical Session (Laboratory Component) 40 % 20
2 Semester End Examination (SEE) 100 % 50
ASSESSMENT DETAILS
Continuous Internal Assessment (CIA) (50%) Semester End Exam (SEE) (50%)
Practical Sessions (40%)
Continuous Internal Evaluation (CIE) (60%)
I II III
Syllabus Coverage Syllabus Coverage Syllabus Coverage
40% 30% 30% 100% 100%
MI MI MI
MII MII MII MII
MIII MIII MIII
MIV MIV MIV
MV MV MV
NOTE:
● Assessment will be both CIA and SEE.

● The practical sessions of the IPCC shall be for CIE only.

● The Theory component of the IPCC shall be for both CIA and SEE respectively.

● The questions from the practical sessions shall be included in Theory SEE.
Note: For Examinations (both CIE and SEE), the question papers shall contain the questions mapped to the
appropriate Bloom’s Level. Any COs mapped with higher cognitive Bloom’s Level may also be assessed through the
assignments.
SEE QUESTION PAPER PATTERN:

1. The question paper will have TEN full questions from FIVE Modules
2. There will be 2 full questions from each module. Every question will carry a maximum of 20 marks.
3. Each full question may have a maximum of four sub-questions covering all the topics under a module.
4. The students will have to answer FIVE full questions, selecting one full question from each module.
Text Books:

1. John E. Hopcroft, Rajeev Motwani, Jeffrey D.Ullman: Introduction to Automata Theory, Languages and
Computation, 3rd Edition, Pearson Education, 2013. (Chapters: 1, 2, 3, 4, 5, 6, 7)
1. K L P Mishra, N Chandrasekaran, 3rd Edition, Theory of Computer Science, PhI, 2012. (Chapters: 9, 10, 12)
Reference Books:

1. Fundamentals of Data Structures in C, Ellis Horowitz and Sartaj Sahni, Universities Press, 2nd Ed, 2014.
2. Data Structures Schaum's Outlines, Seymour Lipschutz, McGraw Hill, Revised 1st Ed, 2014
3. Data Structures: A Pseudo-code approach with C, Gilberg & Forouzan, Cengage Learning, 2nd Ed, 2014
4. Data Structures using C, Reema Thareja, Oxford press, 3rd Ed, 2012
5. An Introduction to Data Structures with Applications, Jean-Paul Tremblay & Paul G. Sorenson, McGraw Hill,
2nd Ed, 2013

1. Data Structures using C, A M Tenenbaum, PHI, 1989


Lab Program 1:

Design, Develop and Implement a menu driven


Program in C for the following Array operations
a. Creating an Array of N Integer Elements
b. Display of Array Elements with Suitable Headings
c. Inserting an Element (ELEM) at a given valid
Position (POS)
d. Deleting an Element at a given valid
Position(POS)
e. Exit.
Support the program with functions for each of the
above operations.
#include<stdio.h>
#include<stdlib.h>
#define MAX 5

int a[MAX], pos, elem;


int n = 0;

void create();
void display();
void insert();
void delete();

void main()
{
int choice;
while(1)
{
printf("\n\n~~~~MENU~~~~");
printf("\n=>1. Create an array of N integers");
printf("\n=>2. Display of array elements");
printf("\n=>3. Insert ELEM at a given POS");
printf("\n=>4. Delete an element at a given POS");
printf("\n=>5. Exit");
printf("\nEnter your choice: ");
scanf("%d", &choice);
switch(choice)
{
case 1: create();
break;
case 2: display();
break;
case 3: insert();
break;
case 4: delete();
break;
case 5: exit(1);
break;
default: printf("\nPlease enter a valid choice:");
}
}
}

void create()
{
int i;
printf("\nEnter the number of elements: ");
scanf("%d", &n);
printf("\nEnter the elements: ");
for(i=0; i<n; i++)
{
scanf("%d", &a[i]);
}
}

void display()
{
int i;
if(n == 0)
{
printf("\nNo elements to display");
return;
}
printf("\nArray elements are: ");
for(i=0; i<n;i++)
printf("%d\t ", a[i]);
}

void insert()
{
int i;

if(n == MAX)
{
printf("\nArray is full. Insertion is not possible");
return;
}

do
{
printf("\nEnter a valid position where element to be inserted: ");
scanf("%d", &pos);
}while(pos > n);

printf("\nEnter the value to be inserted: ");


scanf("%d", &elem);

for(i=n-1; i>=pos ; i--)


{
a[i+1] = a[i];
}
a[pos] = elem;
n = n+1;
display();
}
void delete()
{
int i;

if(n == 0)
{
printf("\nArray is empty and no elements to delete");
return;
}

do
{
printf("\nEnter a valid position from where element to be deleted: ");
scanf("%d", &pos);
}while(pos>=n);

elem = a[pos];

printf("\nDeleted element is : %d \n", elem);


for( i = pos; i< n-1; i++)
{
a[i] = a[i+1];
}
n = n-1;
display();
}

Output:

~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 1

Enter the number of elements: 3


Enter the elements: 10 20 30

~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 2

Array elements are: 10 20 30

~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 3

Enter a valid position where element to be inserted: 5


Enter a valid position where element to be inserted: 4
Enter a valid position where element to be inserted: 3
Enter the value to be inserted: 40

Array elements are: 10 20 30 40

~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 3

Enter a valid position where element to be inserted: 4


Enter the value to be inserted: 50

Array elements are: 10 20 30 40 50

~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 3

Array is full. Insertion is not possible

~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 4

Enter a valid position from where element to be deleted: 5


Enter a valid position from where element to be deleted: 6
Enter a valid position from where element to be deleted: 4
Deleted element is: 50

Array elements are: 10 20 30 40

~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 4

Enter a valid position from where element to be deleted: 2


Deleted element is: 30

Array elements are: 10 20 40

~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 4

Enter a valid position from where element to be deleted: 1


Deleted element is: 20

Array elements are: 10 40

~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 4

Enter a valid position from where element to be deleted: 0


Deleted element is: 10

Array elements are: 40

~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 4

Enter a valid position from where element to be deleted: 0


Deleted element is: 40

No elements to display
~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 4

Array is empty and no elements to delete

~~~~MENU~~~~
=>1. Create an array of N integers
=>2. Display of array elements
=>3. Insert ELEM at a given POS
=>4. Delete an element at a given POS
=>5. Exit
Enter your choice: 5

You might also like