Question: Q 2 . ( a ) Model traffic control at a turning point using an appropriate data structure. Show using pseudocodes how will you implement
Qa Model traffic control at a turning point using an appropriate data structure. Show using
pseudocodes how will you implement entry and exit of traffic.
b Consider a string consisting of all the letters of your firstname and lastname. Ensure that the
string consists of a minimum of and a maximum of characters. You may append alphabets
by repeating from your firstname and lastname or truncate alphabets from your firstname and
lastname. Represent this string using a binary tree with the first character as the root. Your goal
should be to make this tree as complete as possible. Examine if your final tree is i almost
complete binary and ii heightbalanced.
c Show a problem where a graph representation of data can be beneficial. You should clearly
define the problem and the representation.Answer all questions
Qa Differentiate between a linear and a nonlinear data structure with one example in each
category.
b Define a strictly binary tree with an example. Prove using mathematical induction that a
strictly binary tree with leaves contains nodes.
c Define a linear linked list. How can you represent a node in a i a singly connected linear
linked list and ii a doubly connected linear linked list?
d Prove or disprove: A connected graph is always complete.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
