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

Write a method isSorted that returns true if the list is in sorted (nondecreasing) order and returns false otherwise. An empty l

ist is considered to be sorted.
Computers and Technology
1 answer:
kozerog [31]3 years ago
8 0

Answer:

// This method is written in Java Programming Language

// Comments are used for explanatory purpose

// Method starts here

// Declare method isSorted

public boolean isSorted() {

// Create a listnode

ListNode lst = list;

// Check if list is null

if (list == null) {

return true;

}

// Iterate while list is not null

while (lst.next != null) {

// Get current list item

ListNode current = lst.next;

// Compare; if less than, return false

if (current.data < lst.data) {

return false;

}

// Assign current to lst

lst = current;

}

return true;

}

You might be interested in
Which payment type is best if you are trying to stick to a budget?
nignag [31]

Answer:

debit card, credit cards usually make people overspend, and cash advance is a bad fee (like $10 minimum usually), and loans have interest

Explanation:

6 0
3 years ago
Declare an array named a of 10 elements of type int and initialize the elements (starting with the first) to the values 10, 20,
kherson [118]

Answer:

int a[10] = {10,20,30,40,50,60,70,80,90,100};

Explanation:

In the above statement, we declare the integer data type array variable that is 'a' then, pass its index value that is 10 which means it contains only 10 values and initialize the components of the array variable that is starting with 10 and end at 100 in the difference of 10. So, the following declaration is correct according to the statement.

5 0
3 years ago
When changing passwords, at least how many characters must be changed from the previous password?
frosja888 [35]

As we change password when

1. we forgot the previous password.

2. when the previous password is leaked due to some reasons.

In case 1 we can change the password to the same as well with no change the problem will be solved but for case 2 at least one or for more safety all characters should be changed.

8 0
3 years ago
2. Create a file with the follow integer/string content and save it as fun.txt. 6 fun. 3 hello 10 &lt;&gt; 2 25 4 wow! Write an
Nesterboy [21]

Answer:

see explaination

Explanation:

I made use of python program to solve this.

text file name with fun.txt.

6 fun. 3 hello 10 <> 2 25 4 wow!

Program code:

import re

file = open('fun.txt','r') #for reading file

strings="" #declaring empty string

for k in file:

strings=strings+k #all character in file is storing in strings variable for do operations

pattern = '\s' #for pattern \s is for space

result = re.split(pattern, strings) #split the string with space

for k in range(len(result)): #loop through the list of string

if(k%2) == 0: #checking for integer to time of string

p=int(result[k])

print(result[k+1] *p) #print times of the string(k+1)

Check attachment for output

8 0
3 years ago
You can insert pictures,such as scanned photographs, line art, and artwork, into a presentation. (points : 2) true false
Lady bird [3.3K]
True, i have done this before in my presentation slides
5 0
3 years ago
Other questions:
  • Which line of code will generate a random integer between 7 and 77?
    10·1 answer
  • Is it possible to uninstall a program that's on your phone from computer?
    8·1 answer
  • When Liam went to print his presentation, the boot process established the connection to the printer, sent the presentation to t
    12·1 answer
  • The advancement in speed of transportation is attributed to invention of this device
    8·1 answer
  • How many times do you return after the dateline ?
    12·1 answer
  • Which of the following is not the disadvantage of closed
    7·2 answers
  • Explain the term creating in word processing​
    12·1 answer
  • A flower is an example of _______________? (Select the best answer.)
    13·2 answers
  • Juan wrote a loop to print all the prime numbers between 1 and 100. But instead of stopping at 100, it continues on and on forev
    5·1 answer
  • Describe how a user would interact with a smart-phone to do various tasks.Consider inputs and outputs.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!