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
Artemon [7]
3 years ago
12

Write a pseudocode method swap(aList, i, j) that interchanges the items currently in positions i and j of a list. Define the met

hod in terms of the operations of the ADT list, so that it is independent of any particular implementation of the list. Assume that the list, in fact, has items at positions i and j. What impact does this assumption have on your solution
Computers and Technology
1 answer:
serious [3.7K]3 years ago
6 0

Answer:

Explanation:

The following pseudocode for this method using operations of the ADT list would be the following

swap(aList, indexI, indexJ) {

    initialize temp_variable = Retrieve(indexI, aList)

    Insert(Retrieve(indexJ, aList), indexI, aList)

    Insert(Retrieve(indexI, aList), temp_variable, aList)

}

This code basically saves the aList index of i , into a temporary Variable. Then it sets the aList index of i to the value of the element in index of j. Then it does the same for the index of j with the tem_variable. If we assume that the indexes of i and j exist, then it can crash our entire program if those indexes are missing from the list when we try to access them.

You might be interested in
List three possible ways a company can process your data through<br> their privacy policy.
Feliz [49]

Answer:

A company will only process your personal data when they have a legal basis for doing so.

The legal basis to process personal data will one of the following:

1.For the performance of contract:  for recruitment process, for human resource management, and to manage those carrying out work on behalf of PI.

2.For legal requirement:  to comply with applicable regulatory obligations and employment law.

3.For their legitimate interests: to administer their website, to manage their donations, to carry out research and investigations and to manage volunteer.

7 0
2 years ago
Which of the following would a cyber criminal most likely do once they gained access to a user id and password
Bogdan [553]

Answer:

do something wrong as you

3 0
2 years ago
A java ____ is a program written in the java programming language that can be included in a web page.
Evgen [1.6K]

Answer:

Java Applets are used to include java programs on web page.

Explanation:

Java Applets are small java programs that can be run on any browser with appropriate Java Plug-in and displays applet as a section of web page.

How to Create Applet

Create an applet class by extending it with JApplet and add a paint method in it. for example

import java.awt.*;

import javax.swing.*;

public class HelloWorld extends JApplet {

          public void paint(Graphics graphic)

           {

            super.paint(graphic);

           }

}

The above code will create an applet and super.paint(graphic) method will draw the applet for you.

In order to display "Hello World" string in applet. you just need to add the following line after super.paint(graphic); method.

graphic.drawString("Hello World" , 20, 20);

Run Code

Click on Run Button and you will able to see the applet in applet viewer window.

4 0
3 years ago
Read 2 more answers
Which number expresses 6.72 as a fraction in simplest form?<br>​
Ymorist [56]
What are the answer choices
8 0
3 years ago
How is a LCD screen and view finder similar?
dem82 [27]

Answer:

LCD screens have advantages, but so do optical viewfinders. ... Unlike the optical viewfinder, the LCD screen displays the entire frame that the sensors capture. Optical viewfinders, even on a professional level DSLR, only show 90-95% of the image. You lose a small percentage on the edges of the image.

Explanation:

6 0
3 years ago
Other questions:
  • Which of these jobs would be most appropriate for someone who majors in computer engineering? I need the answer ASAP Helping com
    14·2 answers
  • Identify the mobile device deployment option that gives the user flexibility to select a device, but allows the company to contr
    5·1 answer
  • Meg is in the process of creating a storyboard for her personal website, but she is unable to decide which storyboarding techniq
    10·1 answer
  • Ross has to create a presentation for his class but can't decide on a topic. What should he do?
    14·2 answers
  • Dayla is concerned about managing her digital footprint. What does she mean by this? *
    7·1 answer
  • Which routing protocol does an exterior router use to collect data to build its routing tables?
    8·1 answer
  • The _______ displays the data series in separate columns side-by-side so that you can compare the relative heights of the column
    5·2 answers
  • Remember that kid who would always ask you for your food, even though he packed his own lunch.
    8·2 answers
  • Assume that the message M has to be transmitted. Given the generator function G for the CRC scheme, calculate CRC. What will be
    15·1 answer
  • Write the Python programs for the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!