1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
dimaraw [331]
3 years ago
14

Suppose an initially-empty queue Q has performed a total of 32 enqueue operations, 10 front operations, and 15 dequeue operation

s, 5of which generated EmptyQueueExceptions, which were caught and ignored. What is the current size of Q?
Computers and Technology
1 answer:
Natasha_Volkova [10]3 years ago
6 0

Answer:

22

Explanation:

1. We are going to have at hand 32 Enqueue Operation, with 10 from front and 15 dequeue and 5 empty queue operation

2. You dequeued total number of 15-5 =10 elements since 5 dequeue did not change the state of the queue, so invariably 10 dequeue is done.

3. Next is to enqueued a total of 32 elements.

Enqueue Operation do not change the state(and Size) of the queue, and can be ignored.

4. To arrive at the Total Size of queue, we will have 32-10 = 22 at the end

Answer : 22 because its a 5 dequeue Operations.

You might be interested in
Guidelines:
OverLord2011 [107]

Answer:

See Explaination

Explanation:

def merge(listA, listB):

if not listA:

return listB

if not listB:

return listA

# create a empty resulting list(merged list)

result = []

# check the first elements of list listA, listB)

if(listA[0]<listB[0]):

# append the first element of listA to result

result.append(listA[0])

# use recursion to get remaning elements

# listA is now reduced to listA[1:]

result.extend(merge(listA[1:],listB))

else:

# append the first element of listB to result

result.append(listB[0])

# use recursion to get remaning elements

# listB is now reduced to listB[1:]

result.extend(merge(listA,listB[1:]))

# return the resultant list

return result

def largest_sum(xs, x, y):

# get number of rows and columns

m = len(xs[0])

n = len(xs)

# if move is invalid

if(x>=n or y>=m):

return 0

# check if we have reached boundary then return xs[x][y]

if(x==(n-1) and y==(m-1)):

return xs[x][y]

else:

# return max of two possible moves(leftmove, down move)

# move left (in this increment x)

left = xs[x][y] + largest_sum(xs,x+1,y)

# move down (in this increment y)

down = xs[x][y] + largest_sum(xs,x,y+1)

# return the maximum of two possible moves

if(left>down):

return left

else:

return down

# test code

print("Output for sample test cases given in problem:")

print(merge([1,2,3], [4,5,6]))

print(largest_sum([[1,2],[3,0]],0,0))

print(largest_sum([[5,6,1],[2,3,3]],0,0))

print(largest_sum([[0,7,5],[6,-1,4],[-5,5,2]],0,0))

print(largest_sum([[0,7,5],[6,-1,4],[-5,5,2]],1,1))

8 0
3 years ago
What is difference between RAM and ROM?
Lesechka [4]
Hi pupil here's your answer ::


________________________

RAM ::

● Data can be read and written on the RAM chip at any number of times.

● The operating system, application programs and the user data is stored in Ram only until the computer is powered on.

● Ram is a volatile memory that loses its contents when the computer is switched off.

● The size of RAM makes a difference in the processing, i.e. the bigger size of the RAM the greater is the speed of processing.

ROM ::

● Data can only be read from the ROM chip.

● Only system programs are stored in ROM. It can't be used to store user data and other programs.

● ROM is non volatile memory the data stored in ROM is permanent in nature.

● Size of the ROM has nothing to do with processing.


________________________

hope this helps. . . .
5 0
4 years ago
Terry is having a problem with his computer screen. He said the screen looks distorted. When you go to check his monitor, you no
sp2606 [1]

Answer:

C. The computer's resolution has been set too low

Explanation:

When the screen of a system looks distorted and the desktop icons do not appear properly, it's a sign of low screen resolution.

This is often caused by the lack of proper display driver.

To fix this, one need to update the graphic driver. The graphic card is always available on the manufacturer's website for download download of latest drivers.

Also, screen resolution can be changed by performing the following tasks.

1. Goto Control Panel

2. Under Appearance and Personalization, click Adjust screen resolution.

3. Click the drop-down list next to Resolution,

4. Move the slider to the resolution you want

5. Click Apply.

5 0
4 years ago
1. Name a two methods for creating text in Adobe Illustrator.
Fittoniya [83]

Answer:

Point type is a horizontal or vertical line of text that begins where you click and expands as you enter characters. Each line of text is independent—the line expands or shrinks as you edit it, but doesn’t wrap to the next line. Entering text this way is useful for adding a few words to your artwork.

Select the Type tool  or the Vertical Type tool .

The pointer changes to an I-beam within a dotted box. The small horizontal line near the bottom of the I-beam marks the position of the baseline, on which the text rests.

(Optional) Set text-formatting options in the Control panel, Character panel, or Paragraph panel.

Click where you want the line of text to begin.

Explanation:

4 0
3 years ago
If a class contains more than one constructor, describe how the computer determines the appropriate constructor. provide an exam
notsponge [240]
If a class contains more than one constructor, computer determines the appropriate constructor by matching all the attributes, like the number, data type and position. Here's the example where the row public AirConditioner(){} is the default constructor that can use <span>default settings or initialize manually (sorry for tabulation, not my fault)</span>:
<span>class AirConditioner{   enum ConditionerMode{      Automatic,  }   public ConditionerMode Mode;   public int MinTemperature = 18;   public int MaxTemperature = 20;
   public AirConditioner(){    }
   public AirConditioner(ConditionerMode mode){       Mode = mode;   }     public AirConditioner(ConditionerMode mode, int MinTemp, int MaxTemp){      Mode = mode;      MinTemperature = MinTemp;      MaxTemperature = MaxTemp;   }}</span>
5 0
3 years ago
Other questions:
  • Help 30 points I will mark brainliest!!!!!!!!!!!
    10·1 answer
  • Technician A says that as volume decreases, pressure increases. Technician B says that as temperature increases, pressure decrea
    5·1 answer
  • Jim works the parts counter for a busy car dealership. When answering the phone, Jim often has trouble answering the customer's
    6·1 answer
  • When the hyper-v role is added to a windows server 2012 r2 server, what is loaded first during boot?
    6·1 answer
  • How do you bookmark a website in each of the internet browsers?
    9·1 answer
  • To use the Report Wizard to create a report for a query, select the query in the Navigation Pane, click ____ on the ribbon, and
    13·1 answer
  • . What is a destructor and what is its purpose?
    5·1 answer
  • Write one paragraph: Do you feel comfortable giving out personal information online? Why or why not? Is there a limit to what yo
    8·1 answer
  • Which command is used to copy entire folder structures between volumes or across a network while maintaining all NTFS file permi
    10·1 answer
  • The Internet Protocol Suite consists of the Internet Protocol and _____. a. Transmission Control Protocol b. File Transfer Proto
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!