Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

Why does the monopsony equilibrium give rise to a deadweight loss?

Answered: 1 week ago

Question

What is body language? Explain its role in business communication.

Answered: 1 week ago