Вопрос задан 21.02.2019 в 01:08. Предмет Алгебра. Спрашивает Изенекова Настя.

если можно с решением

0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Синяков Глеб.

 \sqrt{60} =  \sqrt{4*15} = 2 \sqrt{15}
 (\sqrt{15} -  \sqrt{60}) *  \sqrt{15} =  \sqrt{15}* \sqrt{15} - 2 \sqrt{15}*    \sqrt{15}= 15 -2*30 = \\ =15 - 30 = -15
0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Code Solution for Finding Shortest Distance Between Two Words in a List

To find the shortest distance between two words in a list, you can use the following Java code:

```java public int shortest(String[] words, String word1, String word2) { int min = Integer.MAX_VALUE; int lastPosWord1 = -1; int lastPosWord2 = -1; for (int i = 0; i < words.length; i++) { String currentWord = words[i]; if (currentWord.equals(word1)) { lastPosWord1 = i; int distance = lastPosWord1 - lastPosWord2; if (lastPosWord2 >= 0 && min > distance) { min = distance; } } else if (currentWord.equals(word2)) { lastPosWord2 = i; int distance = lastPosWord2 - lastPosWord1; if (lastPosWord1 >= 0 && min > distance) { min = distance; } } } return min; } ```

This code defines a method `shortest` that takes in an array of words and two target words, and it returns the shortest distance between the two target words in the array. The method iterates through the array, keeping track of the positions of the two target words and updating the minimum distance as it goes.

Explanation of the Code

- The method `shortest` takes in an array of words, `words`, and two target words, `word1` and `word2`. - It initializes `min` to `Integer.MAX_VALUE` to store the minimum distance found so far. - It then iterates through the array of words, updating the positions of `word1` and `word2` and calculating the distance between them. - Finally, it returns the minimum distance found.

This code efficiently finds the shortest distance between two words in a given list.

Let me know if you need further assistance!

0 0

Топ вопросов за вчера в категории Алгебра

Последние заданные вопросы в категории Алгебра

Задать вопрос