Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Prunieim J In Lahore ( L ) , there is a factory that distributes its products to five cities: Qasur ( Q ) , Sheikhupura

Prunieim J
In Lahore (L), there is a factory that distributes its products to five cities: Qasur (Q), Sheikhupura (S), Okara (O), Gujranwala (G), and Muridke (M). Each supply line has a different fuel cost associated with it. Here are the fuel consumption details for the truck transporting the products:
From Lahore (L) to Muridke (M): 300 liters
From Lahore (L) to Qasur (Q): 200 liters
From Lahore (L) to Okara (O): 400 liters
From Qasur (Q) to Okara (O): 200 liters
From Qasur (Q) to Muridke (M): 200 liters
From Qasur (Q) to Gujranwala (G): 600 liters
From Muridke (M) to Gujranwala (G): 100 liters
From Gujranwala (G) to Sheikhupura (S): 200 liters
From Okara (O) to Sheikhupura (S): 300 liters
A consignment of the factory's products needs to be sent to Sheikhupura (S), and the truck has a limited fuel capacity of 650 liters. Determine the best route to deliver the consignment while minimizing fuel consumption using Dijkstra's algorithm.
Problem 4
There is a simple programing language for a specific architecture which can perform four basic arithmetic operations i.e. addition, subtraction, multiplication and division between only two variables x and y. The syntax for these operations are Add, Sub, Mul and Div. Compiler of this programing language converts the each command into bit string of machine language (string of 1's and 0's) which is designed with prefix coding tree. Here is the tree given in the figure. For instance here is an example the command Add x,y is converted into 110010.
i- Show the bit string of the command lx,y.
ii- If x=25 and y=31 show the output of the command 1110100.
Problem 5
Here are the nodes of a tree which are ordered into preorder traversal method.
{Book, Chapter 1,Section 1.1,Section 1.2,Section 1.2.2,Section 1.2.2, Chapter 2, Section 2.1,Section 2.2,Section 2.2.1, Section 2.2.2}
i- Draw the tree. Solve it completely
ii- Apply in-order tree traversal technique on the above drawn tree.
iii- Apply post-order tree traversal technique on the above drawn tree.
ii- If chapter 3 with only one subtopic section 3.1 is included in the tree where will it be placed in given ordered nodes.
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

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions