Screenshot 2024-12-05 at 9.42.56 PM
Screenshot 2024-12-05 at 9.42.56 PM
DROBLEM SI-I|
Semester
Session : 2024-25(Odd Sem.) Subject Code
Course B.Tech. UCS301|
Subject Name Data Structures and
Branch : CS
Group : CS(ALL)
Name of Fnculty Member Algorithms
Mr. ljtaba Salccm Khan,Mr.
Kamlesh Chandra Maurya,Dr.
Satya Bhushan Verma,Ms.
Abhilasha Mandal,Mr. Sunny
Kumar, Ms. Atifa Pravcen,Mr
|Ravi Prakesh Visvakarma,Ms.
Homa Rizvi
Unit
TopicCovered : Pointers and Linked List
Unit-II
1. What is a pointer variable? What is static memory allocation and dynamic memory
allocation?
2. Build a function int strlen(char *str), that computes the length of the string str using
pointers for referring to characters in the string.
3. Build a function char *strepy(char *src), that makes a copy of str using pointers for
referring to characters in the string.
4. Build a function void checkPalindrome(char *str), that does the work using
pointers for referring tocharacters in the string.
5. Write a function char *strreverse(char *orig), that does the work using pointers for
referring to characters in the string.
6. Compare the advantages and disadvantages of using array list and linked list.
7. Describe circular linked list. Implement it using create),insert(), and delete()
functions.
8. Build a function to reverse the linked list in pair If you have a linked list that holds
1234 NULL then after function has been called the linked list would be 2 143
NULL.
of linked list.
9. Builda C program to swap m and nth elements function to insert a
10.Build a Cprogram to implement doubly linked list Write a
node after a particular node given by user.
insert it in the beginning.
11.Builda Cprogram to remove the last node of the list and
Supplementary Questions:
given linked list with first
1. What does following function do for a
node as hrad? void fun1(struct node* head)
if(head--NU
LL) return;
fun1(head->next);
printf( %d",head
>data);
following
theoutput of
2. Whatis voidf(int*p,intm)
program?
m=mt5;
p=*ptm
;return;
void main()
int
i-5,j=10;
f(&lj);
printf("%d"itj);
TEXT BOOKS:
Edition,McGraw Hill2015
T1.Seymour Lipschutz,Data Structures,Reprint First Publications,2012
T2. S. K. Srivastava, DataStructure through Cin Depth,2, BPB
T3.Paritosh K. Bansal, Data Structure using C,2,Krishna Prakashan,2011
REFERENCE BOOKS:
RI. Brian W. Kernighan, Dennis M. Ritchie, The CProgramming Language,2, Pearson Education,2012
R2. Horowitz, Sahani, Anderson-Freed, Fundamentals of Datastructures in C,2,Universities Press,2012
1. Discuss the properties of binary tree. What is Binary Search Tree? How it is
different from Binary Tree? 2L, D-0.
L' of a binary tree is
2. Show that the maximum number of nodes at levcl
: CS
Subject Code :UCS301
hranch
: CS(ALL)
Subject Name Data Structures and Algorithrns
Group Name of Faculty Member :Mr. ljtaba Salcemn Khan,Mr.
Kanlesh Chandra Maurya,Dr. Satya
Bhushan Verma,Ms. Abhilasha
Mandal,Mr. Sunny Kumar, Ms.
Atifa Praveen,Mr Ravi Prakesh
Visvakarma,Ms. Homa Rizvi
Unit :V Topic Covered :Graphs
UNIT- V
1. List five situations from everyday life in which graphs arise naturally.
2. How can a graph be represented using an adjacency matrix? Write an algor1thm
for the same.
3. Create
a simple graph,
ii. a non-simple graph with no loops,
iii. a non-simple graph with nomultiple edges,
Each with five vertices and eight edges.
4. Show that if a graph is simple, then E<=V(V-1)/2.
5. Explain the following termswith the help of examples:
o. In-degree
a. Graph h.Length of Path p. Out-degree
b. Undirected Graph i. losed Path
q. Source
c. Directed Graph j. Simple Path
r. Sink
d. Weighted Graph k. Cycle s. Pendant Node
e. Adjacent Nodes 1. Cyclic Graph t. Isolated Node
f. Incidence
m. Acyclic Graph u. Connected Graph
n. Degree
g. Path
algorithm to
Tree? Explain the Prim's and Kruskal's
Spanning
6. What is Minimumspanning tree. 4}. Entry Wij in
create a minimum undirected graph with vertex set {0, 1, 2, 3,minimum possible
complete the
7. Consider a below is the weight oftheedge {i, j}. What is 0is a leaf node in the
the matrix W that vertex
spanning tree T in this graph such
weight of a
tree T.
1 1 4'
12 4 9
1
W=|8 12 07 3
1 4 7 0 2
4 3 2 0)
have
edges a directed graph with n vertices can
maximum number of
8. What is the
and still not contain a
directed cycle?
with no parallel edges and self-loops are
directed graphs
9. How many simple of V?
possible in terms
between DFS and BFS? graph.
10. Differentiate between every pair of vertices in a given
graph distances
11.Find the shortest given graph doesn't have negative edges.
Let us assume that Algorithm.
implement Warshal
12. Builda Cprogram to
13. Builkd a Cprogram to implement Ditkstra Algorithm
14.Crcate allthespanning trecs inthe graph of Fig-land Fig-2.
b
Fig. 1 Fig. 2
Supplementary Questions:
1. Let Gbe a directed graph whose vertex set is the set of numbers from 1 to
100.There is an edge from a vertex ito a vertex j iff either j=i+1 or j=3i. The
minimum number of edges in a path in Gfrom 1to vertex 100 will be?
2. What is the largest integer m such that every simple connected graph with n
vertices and n edges contains at least mdifferent spanning trees?
TEXT BOOK:
T1. Seymour Lipschutz,DataStructures,Reprint First Edition,McGraw Hill,2015
T2. S. K. Srivastava, Data Structure through Cin Depth,2,BPB Publications,2012
T3. Paritosh K. Bansal, Data Structure using C,2,Krishna Prakashan,2011
REFERENCE BOOK: