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
const2013 [10]
3 years ago
8

Queue is the LIFO structure. o True o False

Computers and Technology
1 answer:
Yakvenalex [24]3 years ago
7 0

Answer:

The answer is False.

Explanation:

By definition LIFO structure is defined by: Last In, First Out.

By definition FIFO structure is defined by: First In, First Out.

A queue has the basics operations push() and pop() where:

  • push(element) stores the element at the end of the queue.
  • element = pop() retrieves the element at the beginning of the queue.

For example:

If you insert the elements doing the push(e) and q.pop(e) operation:

Queue q;

Element e;

q.push(2); // q ={2};

q.push(5); // q ={2 , 5};

q.push(6); // q = {2, 5, 6};

q.pop(e); //  q ={5, 6}; e = 2;

q.push(12); q ={5, 6, 12};

q.pop(e); //  q ={6, 12}; e = 5;

Note: A stack is a LIFO structure.

You might be interested in
given an array of integers a, your task is to count the number of pairs i and j (where 0 ≤ i < j < a.length), such that a[
Nimfa-mama [501]

Using the knowledge of computational language in C++ it is possible to write a code that given an array of integers a, your task is to count the number of pairs i and j.

<h3>Writting the code:</h3>

<em>// C++ program for the above approach</em>

<em> </em>

<em>#include <bits/stdc++.h></em>

<em>using namespace std;</em>

<em> </em>

<em>// Function to find the count required pairs</em>

<em>void getPairs(int arr[], int N, int K)</em>

<em>{</em>

<em>    // Stores count of pairs</em>

<em>    int count = 0;</em>

<em> </em>

<em>    // Traverse the array</em>

<em>    for (int i = 0; i < N; i++) {</em>

<em> </em>

<em>        for (int j = i + 1; j < N; j++) {</em>

<em> </em>

<em>            // Check if the condition</em>

<em>            // is satisfied or not</em>

<em>            if (arr[i] > K * arr[j])</em>

<em>                count++;</em>

<em>        }</em>

<em>    }</em>

<em>    cout << count;</em>

<em>}</em>

<em> </em>

<em>// Driver Code</em>

<em>int main()</em>

<em>{</em>

<em>    int arr[] = { 5, 6, 2, 5 };</em>

<em>    int N = sizeof(arr) / sizeof(arr[0]);</em>

<em>    int K = 2;</em>

<em> </em>

<em>    // Function Call</em>

<em>    getPairs(arr, N, K);</em>

<em> </em>

<em>    return 0;</em>

<em>}</em>

See more about C++ code at brainly.com/question/17544466

#SPJ4

4 0
1 year ago
What are the two options for adding a new slide into presentations?
nirvana33 [79]
The first being Ctrl+M and the second being clicking the <span>top half of the New Slide button</span>
5 0
3 years ago
Which format is used for audio files?
Arisa [49]
Audio format is used for audio files
7 0
3 years ago
Read 2 more answers
The area of a parallelogram is 18 square units.one side of the parallelogram is 24 units long.The other side is 6 unit long. whi
taurus [48]

Answer:

Height = \frac{3}{4}\ unit

Height = 3\ units

Explanation:

Given

Shape: Parallelogram

Area = 18 unit^2

Side\ 1 = 24  units

Side\ 2 = 6 units

Required

Determine possible heights of the parallelogram

Area of parallelogram is:

Area = Base * Height

Make Height the subject of formula

Height = \frac{Area}{Base}

When Base = 24 units;

Height = \frac{18}{24}

Height = \frac{3}{4}\ unit

When Base = 6 units;

Height = \frac{18}{6}

Height = 3\ units

8 0
3 years ago
an ssl client has determined that the certificate authority (ca) issuing a server's certificate is on its list of trusted cas. w
TEA [102]

The next step in verifying the server's identity is:

  • The CA's public key need to validate the CA's digital signature found on the server certificate.

<h3>What is SSL client?</h3>

Secure Sockets Layer (SSL) is known to be a kind of PKI protocol that helps to  authenticate a user's identity and it is one that often encrypt the communication that takes place between the client and the server.

Note that  in the above, the next step in verifying the server's identity is:

  • The CA's public key need to validate the CA's digital signature found on the server certificate.

Learn more about SSL client from

brainly.com/question/14425531

#SPJ11

8 0
2 years ago
Other questions:
  • Which of the following correctly describes the reason for quality customer service?
    15·2 answers
  • (Palindrome integer) Write the methods with the following headers // Return the reversal of an integer, i.e., reverse(456) retur
    9·1 answer
  • To support continuous improvement efforts in the workplace, you increase the number of tasks that an employee performs and have
    7·1 answer
  • The way a program is proceed is know as control flow and are :Sequence(one line after the other), Decision-making(either this or
    8·1 answer
  • Which of the following is an example of an output device
    13·1 answer
  • Krya needs help deciding which colors she should use on her web page. What can she use to help her decide.
    11·1 answer
  • Among your selection in different online interfaces, which are your top three favorites?​
    7·2 answers
  • Leo needs to consolidate data in multiple worksheets by performing a calculation across all worksheets on the same cells.
    12·2 answers
  • Terri needs to insert a cover page into her document. Where should she go to access the commands to do so? Insert tab, Objects g
    14·1 answer
  • Hillary’s family is thinking of relocating to a different city to save money. They set up a budget comparing the cost of living
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!