Question: Q 2 . ( a ) Model traffic control at a turning point using an appropriate data structure. Show using pseudocodes how will you implement

Q2.(a) 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 10 and a maximum of 20 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) height-balanced.
(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
Q1.(a) Differentiate between a linear and a non-linear 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 n leaves contains (2n-1) 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.
 Q2.(a) Model traffic control at a turning point using an appropriate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!