subject
Engineering, 05.05.2020 04:41 odinmorton

Question 1 (20 points): a. Consider the "circular" array implementation of a queue, similar to ArrayQueue that we studied in class, where the only difference is that the initial capacity is set to 4 (INITIAL_CAPACITY=4): class ArrayQueue: INITIAL_CAPACITY = 4 def __init__(self): self. data_arr = make_array(ArrayQueue. INITIAL_CAPACITY) self. num_of_elems = 0 self. front_ind = None def __len__(self): … def is_empty(self): … def enqueue(self, elem): … def dequeue(self): … def first(self): … def resize(self, new_cap): … Show the values of the data members: front_ind, num_of_elems, and the contents of each data_arr[i] after each of the following operations. If you need to increase the capacity of data_arr, add extra slots as described in class.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Apump is used to circulate hot water in a home heating system. water enters the well-insulated pump operating at steady state at a rate of 0.42 gal/min. the inlet pressure and temperature are 14.7 lbf/in.2, and 180°f, respectively; at the exit the pressure is 60 lbf/in.2 the pump requires 1/15 hp of power input. water can be modeled as an incompressible substance with constant density of 60.58 lb/ft3 and constant specific heat of 1 btu/lb or. neglecting kinetic and potential energy effects, determine the temperature change, in °r, as the water flows through the pump.
Answers: 1
question
Engineering, 04.07.2019 18:10
Which one from below is not one of the reasons of planning failures? (clo3) a)-planner is careless. b-planner spend less time in the field but more time on the desk c)-planner is not qualified d)-planner does not have sufficient time to properly plan
Answers: 3
question
Engineering, 06.07.2019 03:10
Air is flows through an adiabatic nozzle with an inlet pressure of 400 psia at a temperature of 300°f and a velocity of 20 ft/s. the outlet pressure is 40 psia and the velocity is 800 ftl/s. determine the outlet temperature of the air using: a) property tables b) specific heat (using the specific heat value for air at 300°f)
Answers: 3
question
Engineering, 06.07.2019 03:20
Acountershaft is supported by two tapered roller bearings using indirect mounting. the radial bearing loads are 1120 lb for the left-hand bearing and 2190 lb for the right-hand bearing. the shaft rotates at 400 rpm and is to have an l10 life of 40,000 hours and an application factor of 1.4. assume ka2k 15, and find the required radial rating of each bearing
Answers: 3
You know the right answer?
Question 1 (20 points): a. Consider the "circular" array implementation of a queue, similar to Array...
Questions
question
Health, 13.12.2019 08:31
question
Mathematics, 13.12.2019 08:31
question
Mathematics, 13.12.2019 08:31
question
Mathematics, 13.12.2019 08:31
Questions on the website: 13722363