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
Gekata [30.6K]
3 years ago
12

A Queue can be used to implement a line in a store. If George, Judy, John, and Paula get in line and the cashier checks out two

customers. Who is the person in line that would be checked out next? (This is a so-called "peek" operation on queues). Group of answer choices Return John, and remove him from the line. Return John Return John and Paula
Computers and Technology
1 answer:
Pie3 years ago
3 0

Answer:

Explanation:

The following code is written in Java. It creates a Queue/Linked List that holds the names of each of the individuals in the question. Then it returns John and removes him and finally returns Paula and removes her.

package sample;

import java.util.*;

class GFG {

   public static void main(String args[])

   {

       Queue<String> pq = new LinkedList<>();

       pq.add("John");

       pq.add("Paula");

       pq.add("George");

       pq.add("Judy");

       System.out.println(pq.peek());

       pq.remove("John");

       System.out.println(pq.peek());

       pq.remove("Paula");

   }

}

You might be interested in
In this exercise, you'll raise a manual exception when a condition is not met in a particular function. In particular, we'll be
Shtirlitz [24]
Dhjejekewk that’s a lot
8 0
3 years ago
It is usually simple to delete old posts and online conversations if they make you look bad.
denis23 [38]

Answer:

not usually..sorry :(

Explanation:

7 0
3 years ago
Write a function called missing_letters that takes a string parameter and returns a new string with all the letters of the alpha
kompoz [17]

A string parameter and returns new string with all the letters of the alphabet that are not in the argument string. The letters in the returned string should be in alphabetical order. The implementation should uses a histogram from the histogram function

Explanation:

The below code is written in python :

alphabet = "abcdefghijklmnopqrstuvwxyz"

test_dups = ["zzz","dog","bookkeeper","subdermatoglyphic","subdermatoglyphics"]

test_miss = ["zzz","subdermatoglyphic","the quick brown fox jumps over the lazy dog"]

def histogram(s):

   d = dict()

   for c in s:

       if c not in d:

           d[c] = 1

       else:

           d[c] += 1

   return d

def has_duplicates(s):

   for v in histogram(s).values():

       if v > 1:

           return True

   return False

def test_dups_loop():

   for s in test_dups:

       print(s + ':', has_duplicates(s))

def missing_letters(s):

   r = list('abcdefghijklmnopqrstuvwxyz')

   s = s.lower()

   for c in s.lower():

       if c in r:

           r.remove(c)  # the first matching instance

   return ''.join(r)

def test_miss_loop():

   for s in test_miss:

       print(s + ':', missing_letters(s))

def main():

   test_dups_loop()

   test_miss_loop()

if __name__ == '__main__':

   main()

6 0
4 years ago
Describe shortly about the following Linux directories and theirpurpose,1. lib2. etc3. Boot4. Root5. home
Bingel [31]

Answer:

 Linux directories and their purposes are:

1) lib - Lib file contained the share object library file which necessary to boots system and this directory contain file module stored in the kernel.

2) etc - etc file is the configuration file that they are local in the machines. When the program run these file are stored in the directories. this can be static and do not executable directory.

3) Boot - Boot file are stored in the directory which required processing of linux boot and such files are included in the linux kernel of the file.

4) Root - Root file are the best user root directory and user cannot view this directories from there account. This file usually contain administrative file system.  

5) Home - Home file contained the user directory and it is the default system of linux. Home directory helps user to enable any network system to access there home directories.

5 0
3 years ago
When creating a report,you can mske groups and subgroups by?​
Mnenie [13.5K]

Answer:

content of the report

Explanation:

  • you must clarify all things
  • the report would be clean and clear
7 0
2 years ago
Other questions:
  • Given the strings s1 and s2 that are of the same length, create a new string consisting of the last character of s1 followed by
    10·1 answer
  • Disk requests come in to the disk driver for cylinders 10, 22, 20, 2, 40, 6, and 38, in that order. A seek takes 6 msec per cyli
    6·1 answer
  • If Chris has a car liability insurance, what damage would he be covered for
    10·1 answer
  • which statement draws an accurate comparison between social media marketing and conventional marketing?
    13·1 answer
  • The Coins class was created to hold all your loose change, kind of like a piggy bank! For this exercise, you are going to simula
    15·1 answer
  • Join zoom meet <br>id=547 458 9345<br>pw=sencHURI​
    8·2 answers
  • Which of the following keywords is used to remove a row in a table? (Points : 2) DROP
    11·1 answer
  • Which computer was part of the first generation of computers?
    14·2 answers
  • CLICK ME IF U DARE hehehe
    10·2 answers
  • Answer This One Question Right For Brainliest
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!