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
BlackZzzverrR [31]
3 years ago
6

Which expression correctly determines that String s1 comes before String s2 in lexicographical order

Computers and Technology
1 answer:
Assoli18 [71]3 years ago
8 0

Options :

A.) s1 < s2

B.) s1 <= s2

C.) s1.compareTo(s2) == −1

D.) s2.compareTo(s1) < 0

E.) s1.compareTo(s2) < 0

Answer: E.) s1.compareTo(s2) < 0

Explanation: Lexicographical ordering simply means the arrangement of strings based on the how the alphabets or letters of the strings appear. It could also be explained as the dictionary ordering principle of words based on the arrangement of the alphabets. In making lexicographical comparison between strings, the compareTo () method may be employed using the format below.

If first string = s1 ; second string = s2

To compare s1 with s2, the format is ;

s1.compareTo(s2) ;

If s1 comes first, that is, before s2, the method returns a negative value, that is a value less than 0 '< 0', which is the case in the question above.

If s2 comes first, that is, before s1, the method returns a positive value, that is a value greater than 0 '> 0'.

If both are s1 and s2 are the same, the output will be 0.

You might be interested in
Why is technology bad for you
Inessa05 [86]

Answer: Constant device use might strain your eyes. It can cause a headache, focus issues, itching, blurred or double vision, and light sensitivity. This is one of the main arguments against technology that we may make.

Explanation:

3 0
1 year ago
Read 2 more answers
Find the mistakes in the following code. Not all lines contain mistakes. Each line depends on the lines preceding it. Watch out
Kazeer [188]

Answer:

Explanation:

A null pointer is pointing to nothing, if we can detect if a pointer is null, we can use an "IF" because a null pointer always going to be false, a null pointer even can block an application, because is a result of undefined behavior, it can even cause problems because the compiler can’t tell whether we mean a null pointer or the integer 0, there is a confusion in this kind of pointers.

5 0
3 years ago
What was bill gates first operating system he created?
vagabundo [1.1K]
Microsoft windows was his first

3 0
3 years ago
Create a database with information about products in a catalog. As you plan, keep in mind that later you will want to sort this
nika2105 [10]

pro.no. Qty  Price  Description

1            23   1.00     Apple

2           90   1.00     Banana

3           16    1.00     Orange

4           124  1.00     Pear

5           98   1.00     Blue Berry

6           25   1.00     Raspberry

7           76   1.00     Black Berry

8           00   1.00     Pineapple

9           231  1.00     Green Grape

10          689 1.00     Red Grape

11           2      1.00     Watermellon

3 0
3 years ago
Read 2 more answers
Which one of the following items is an example of software?
Harlamova29_29 [7]
Word processing program is an example of a software. All the others, such as Printer, Keyboard and Mouse are examples of Computer peripheral devices or in short hardware devices. Generally these listed hardware devices come under input or output computer device category. Also, by classic meaning in layman terms these hardware components can be touched or felt. In contrast, a word processing program is a part of a computer system that consists of data or computing instructions and provides the mechanism to computer to perform a certain task utilizing it's hardware resources. Such components of computer system which are written using one of the computer languages are called computer software or software programs or simply software.
4 0
3 years ago
Other questions:
  • Swiping up with three fingers on mac os x launches what?
    8·1 answer
  • The three tasks within data harmonization, namely: data consolidation, data cleansing, and data formatting use techniques called
    8·1 answer
  • How is a correction made to an Electronic health record?
    14·1 answer
  • Fortnite anyone? i just started tdy so dont be judgiee lol
    6·2 answers
  • The material of this section assumes that search keys are unique. However, only small modifications are needed to allow the tech
    7·1 answer
  • Data flow is not a major consideration when building an analytics model. T/F
    13·1 answer
  • Which term is defined as an exploit that takes place before the security community or software developer knows about the vulnera
    12·1 answer
  • Two types of formulas in Excel, what are they? A. Complex and simple, B. General and currency, C. Logical and Boolean, D. Trig a
    15·1 answer
  • WILL GIVE MORE POINTS, PLEASE HELP!!!
    11·1 answer
  • Impromptu speaking ability is very important in the workplace to clearly and effectively communicate ideas. An effective impromp
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!