KEMBAR78
Assignment-3 Data Structure | PDF | Algorithms | Combinatorics
0% found this document useful (0 votes)
4 views2 pages

Assignment-3 Data Structure

The document outlines an assignment for the Data Structure course at KIET Group of Institutions, focusing on tree and graph concepts. It includes two parts with scenario-based questions related to binary trees, binary search trees, and graph applications in social networks and city traffic routing. The assignment spans from November 20, 2024, to December 10, 2024, and specifies marks for each question.

Uploaded by

thepsyforge
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)
4 views2 pages

Assignment-3 Data Structure

The document outlines an assignment for the Data Structure course at KIET Group of Institutions, focusing on tree and graph concepts. It includes two parts with scenario-based questions related to binary trees, binary search trees, and graph applications in social networks and city traffic routing. The assignment spans from November 20, 2024, to December 10, 2024, and specifies marks for each question.

Uploaded by

thepsyforge
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/ 2

KIET Group of Institutions, Ghaziabad

Department of Computer Science


Subject: Data Structure (BCS301) Year/ Sem: 2nd / 3rd

Session: 2024-25

Assignment-3 Based on Tree & Graph


Starting Date: 20 Nov 2024 Ending Date: 10 Dec 2024
Questions CO BL/KC Marks
Part-1 Two Scenario based Conceptual Questions on Tree:
5 Marks
Attempt any one from A.1 or A.2
A.1) Binary Tree in Expression Evaluation
Scenario: You are designing a calculator that can evaluate mathematical
expressions like (3 + 5) * 2 - 9. How would you use a binary tree to
represent this expression?
Question:
Q-1) Demonstrate how the binary tree can be constructed to represent the
4 3/C 2.5
expression, where operators are internal nodes and operands are leaf
nodes.
Q-2) Define the term Root node, Leaf node, internal node, binary tree, and
its types.
A.2) Binary Search Tree (BST) in a Library Management System:
You are designing a library management system where books need to be
organized by their ISBN numbers for quick search and retrieval.
Questions: 4 3/C 2.5
Q-1) Demonstrate, how would you utilize a Binary Search Tree (BST) to
store and search for books by ISBN?
Q-2) What would be the time complexity of this system?
A.3) Problem No. 112 Path Sum (Leetcode) Easy
Given the root of a binary tree and an integer target Sum, return true if
the tree has a root-to-leaf path such that adding up all the values along
the path equals target Sum.
A leaf is a node with no children.
4 4/P 2.5
Input: root = [5,4,8,11, null,13,4,7,2, null, null, null,1], targetSum =
22
Output: true
Two Scenario based Conceptual Questions on Graph: 5 Marks
B.1) Social Network Connectivity 5 4/P
Scenario: You are developing a social networking app. Each user is
represented as a node, and a friendship between two users is 2.5
represented as an edge.
Questions:
Q-1) Which data structure will be used to represent the above
scenario?
Q-2) How would you determine if two users are connected either
directly or through a chain of friends?
Q-3) What algorithm would you use to find the shortest path between
two users, and why?
B.2) City Traffic Routing
Scenario: A city has multiple intersections (nodes) connected by roads
(edges). To optimize traffic flow, you need to find the shortest path
from a central station to all other intersections. 5 2.5
Questions:
4/P
Q-1) Which algorithm would you choose to implement the solution of
this problem.
Q-2) Also discuss other application of used algorithm.

You might also like