Using Python suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).
You are given a target value to search. If found in the array return its index, otherwise return “The input is not on this list”
You may assume no duplicate exists in the array.
Hint: Use a function. Use the built in method .index( ) and/or for loops.

Answers

Answer 1

Answer:

Explanation:

class Solution {

   public int search(int[] nums, int target) {

       int n = nums.length;

       int low = 0 , high = n - 1;

       While(low < high){//Set virtual node

           int mid = (low + high) / 2;

           if(nums[mid] > nums[high]){

               low = mid + 1;

           }else{

               high = mid;

           }

       }

       int rot = low;

       low = 0;

       high = n - 1;

       while(low <= high){

           int mid = (low + high) / 2;

                        Int real = (mid + rot) % n;//The virtual node is mapped to the real node.

           if(nums[real] == target){

               return real;

           }else if(nums[real] < target){

               low = mid + 1;

           }else{

               high = mid - 1;

           }

       }

       return -1;

   }

}


Related Questions

9.19 LAB: Sort an array Write a program that gets a list of integers from input, and outputs the integers in ascending order (lowest to highest). The first integer indicates how many numbers are in the list. Assume that the list will always contain less than 20 integers. Ex: If the input is:

Answers

Answer:

i hope you understand

mark me brainlist

Explanation:

Explanation:

#include <iostream>

#include <vector>

using namespace std;

void vector_sort(vector<int> &vec) {

int i, j, temp;

for (i = 0; i < vec.size(); ++i) {

for (j = 0; j < vec.size() - 1; ++j) {

if (vec[j] > vec[j + 1]) {

temp = vec[j];

vec[j] = vec[j + 1];

vec[j + 1] = temp;

}

}

}

}

int main() {

int size, n;

vector<int> v;

cin >> size;

for (int i = 0; i < size; ++i) {

cin >> n;

v.push_back(n);

}

vector_sort(v);

for (int i = 0; i < size; ++i) {

cout << v[i] << " ";

}

cout << endl;

return 0;

}

what is a high level language?​

Answers

Answer:

a high level language is any programming language that enables development of a program in a much more user friendly programming context and is generally independent of the computers hardware architecture.

Answer:

A high-level language is any programming language that enables development of a program in a much more user-friendly programming context and is generally independent of the computer's hardware architecture.

Write the code to replace only the first two occurrences of the word second by a new word in a sentence. Your code should not exceed 4 lines. Example output Enter sentence: The first second was alright, but the second second was long.
Enter word: minute Result: The first minute was alright, but the minute second was long.

Answers

Answer:

Explanation:

The following code was written in Python. It asks the user to input a sentence and a word, then it replaces the first two occurrences in the sentence with the word using the Python replace() method. Finally, it prints the new sentence. The code is only 4 lines long and a test output can be seen in the attached image below.

sentence = input("Enter a sentence: ")

word = input("Enter a word: ")

replaced_sentence = sentence.replace('second', word, 2);

print(replaced_sentence)

Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicating the number of integers that follow. For coding simplicity, follow each output integer by a comma, including the last one.Ex: If the input is:5 2 4 6 8 10the output is:10,8,6,4,2,To achieve the above, first read the integers into a vector. Then output the vector in reverse.

Answers

Answer:

The program in C++ is as follows:

#include <iostream>

#include <vector>

using namespace std;

int main(){

   vector<int> intVect;

   int n;

   cin>>n;

int intInp;

for (int i = 0; i < n; i++) {

 cin >> intInp;

 intVect.push_back(intInp); }

for (int i = n-1; i >=0; i--) {  cout << intVect[i] << " "; }

 return 0;

}

Explanation:

This declares the vector

   vector<int> intVect;

This declares n as integer; which represents the number of inputs

   int n;

This gets input for n

   cin>>n;

This declares intInp as integer; it is used to get input to the vector

int intInp;

This iterates from 0 to n-1

for (int i = 0; i < n; i++) {

This gets each input

 cin >> intInp;

This passes the input to the vector

 intVect.push_back(intInp); }

This iterates from n - 1 to 0; i.e. in reverse and printe the vector elements in reverse

for (int i = n-1; i >=0; i--) {  cout << intVect[i] << " "; }

the id selector uses the id attribute of an html element to select a specific element give Example ?​

Answers

Answer:

The id selector selects a particular html element

Explanation:

The id selector is uses the id attribute to select a specific html element. For example, if we have a particular header which is an html element and we want to give it a particular background color, we use the id selector and give it an id attribute in the CSS file. An example of an html header with id = 'blue' is shown below. The style sheet is an internal style sheet.

!doctype html

<html>

<head>

<title>Test</title>

<style>

#blue { background-color: blue;

}

</style>

</head>

<body>

<h1 id = 'blue'>Our holiday</h1>

<p>This is the weekend</p>

</body>

</html>

Major findings of evolution of computers

Answers

Answer:

twitt

Explanation:

Switched Ethernet, similar to shared Ethernet, must incorporate CSMA/CD to handle data collisions. True False

Answers

Answer:

False

Explanation:

The Carrier-sense multiple access with collision detection (CSMA/CD) technology was used in pioneer Ethernet to allow for local area networking.  Carrier-sensing aids transmission while the collision detection feature recognizes interfering transmissions from other stations and signals a jam. This means that transmission of the frame must temporarily stop until the interfering signal is abated.

The advent of Ethernet Switches resulted in a displacement of the CSMA/CD functionality.

nowwwwwww pleasssssssss

Answers

the technique used is Data Validation

Compute change
A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. For example, 19 yields 3 fives and 4 ones. Write a single statement that assigns the number of one dollar bills to variable numOnes, given amountToChange. Hint: Use the % operator.
import java.util.Scanner;
public class ComputingChange {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int amountToChange;
int numFives;
int numOnes;
amountToChange = scnr.nextInt();
numFives = amountToChange / 5;
/* Your solution goes here */
System.out.print("numFives: ");
System.out.println(numFives);
System.out.print("numOnes: ");
System.out.println(numOnes);
}
}

Answers

Answer:

Explanation:

The following code is written in Java and modified to do as requested. It asks the user to enter a number that is saved to the amountToChange and then uses the % operator to calculate the number of 5 dollar bills and the number of 1 dollar bills to give back. A test case has been provided and the output can be seen in the attached image below.

import java.util.Scanner;

class ComputingChange {

   public static void main(String[] args) {

       Scanner scnr = new Scanner(System.in);

       int amountToChange;

       int numFives;

       int numOnes;

       amountToChange = scnr.nextInt();

       numFives = amountToChange / 5;

       /* Your solution goes here */

       numOnes = amountToChange % 5;

       System.out.print("numFives: ");

       System.out.println(numFives);

       System.out.print("numOnes: ");

       System.out.println(numOnes);

   }

}

write short note on the following: Digital computer, Analog Computer and hybrid computer​

Answers

Answer:

Hybrid Computer has features of both analogue and digital computer. It is fast like analogue computer and has memory and accuracy like digital computers. It can process both continuous and discrete data. So it is widely used in specialized applications where both analogue and digital data is processed.

Why input screens are better data entry than entreing data dirrctly to a table

Answers

Answer:

are better data entry designs than entering data directly to a table. ... hence a user can design input fields linked to several tables/queries.

Explanation:

Input screens are better data entry designs than entering data directly to a table because a user can design input fields linked to several tables/queries.

What is digital information?

Digital information generally consists of data that is created or prepared for electronic systems and devices such as computers, screens, calculators, communication devices. These information are stored by cloud.

They are converted from digital to analog and vice versa with the help of a device.

Data entered in the table directly is easier than data entry method.

Thus, input screens are better data entry than entering data directly to a table.

Learn more about digital information.

https://brainly.com/question/4507942

#SPJ2

Write a main function that declares an array of 100 ints. Fill the array with random values between 1 and 100.Calculate the average of the values in the array. Output the average.

Answers

Answer:

#include <stdio.h>

int main()

{

   int avg = 0;

   int sum =0;

   int x=0;

   /* Array- declaration – length 4*/

   int num[4];

   /* We are using a for loop to traverse through the array

    * while storing the entered values in the array

    */

   for (x=0; x<4;x++)

   {

       printf("Enter number %d \n", (x+1));

       scanf("%d", &num[x]);

   }

   for (x=0; x<4;x++)

   {

       sum = sum+num[x];

   }

   avg = sum/4;

   printf("Average of entered number is: %d", avg);

   return 0;

}

2. Which tab is used to edit objects on the Slide Master and layouts?
A. View
B. Insert
C. Shape format
D. Design

Answer is not A. View
It’s B. Insert

Answers

Answer:

it is....insert tab..B

Explanation:

insert tab includes editing options

Write the name of test for the given scenario. Justify your answer.

The input values are entered according to the output values. If the results are ok then software is also fine but if results does not matched the input values then means any bugs are found which results the software is not ok. The whole software is checked against one input.

A-Assume you are being hired as a Scrum project Manager. Write down the list of responsibilities you are going to perform.
B-What are the qualifications required to conduct a glass box testing.
C-Write the main reasons of project failure and success according to the 1994 Standish group survey study.
D- Discuss your semester project.

Answers

Answer:

Cevap b okey xx

Explanation:

Sinyorrr

fill in the blanks Pasaline could ----- and ------- very easily.​

Answers

Answer:

Hot you too friend's house and be safe and have a great time to take care of the following is not a characteristic it was a circle whose equation o

In confirmatory visualization Group of answer choices Users expect to see a certain pattern in the data Users confirm the quality of data visualization Users don't know what they are looking for Users typically look for anomaly in the data

Answers

Answer: Users expect to see a certain pattern in the data

Explanation:

Confirmatory Data Analysis occurs when the evidence is being evaluated through the use of traditional statistical tools like confidence, significance, and inference.

In this case, there's an hypothesis and the aim is to determine if the hypothesis is true. In this case, we want to know if a particular pattern on the data visualization conforms to what we have.

Java programming
*11.13 (Remove duplicates) Write a method that removes the duplicate elements from
an array list of integers using the following header:
public static void removeDuplicate(ArrayList list)
Write a test program that prompts the user to enter 10 integers to a list and displays
the distinct integers separated by exactly one space. Here is a sample run:
Enter ten integers: 34 5 3 5 6 4 33 2 2 4
The distinct integers are 34 5 3 6 4 33 2

Answers

Answer:

The program in Java is as follows:

import java.util.*;

public class Main {

public static void removeDuplicate(ArrayList<Integer> list){

 ArrayList<Integer> newList = new ArrayList<Integer>();

 for (int num : list) {

  if (!newList.contains(num)) {

   newList.add(num);  }  }

 for (int num : newList) {

     System.out.print(num+" ");  } }

public static void main(String args[]){

 Scanner input = new Scanner(System.in);

 ArrayList<Integer> list = new ArrayList<Integer>();

 System.out.print("Enter ten integers: ");

 for(int i = 0; i<10;i++){

     list.add(input.nextInt());  }

 System.out.print("The distinct integers are: ");

 removeDuplicate(list);

}}

Explanation:

This defines the removeDuplicate function

public static void removeDuplicate(ArrayList<Integer> list){

This creates a new array list

 ArrayList<Integer> newList = new ArrayList<Integer>();

This iterates through the original list

 for (int num : list) {

This checks if the new list contains an item of the original list

  if (!newList.contains(num)) {

If no, the item is added to the new list

   newList.add(num);  }  }

This iterates through the new list

 for (int num : newList) {

This prints every element of the new list (At this point, the duplicates have been removed)

     System.out.print(num+" ");  } }

The main (i.e. test case begins here)

public static void main(String args[]){

 Scanner input = new Scanner(System.in);

This declares the array list

 ArrayList<Integer> list = new ArrayList<Integer>();

This prompts the user for ten integers

 System.out.print("Enter ten integers: ");

The following loop gets input for the array list

 for(int i = 0; i<10;i++){

     list.add(input.nextInt());  }

This prints the output header

 System.out.print("The distinct integers are: ");

This calls the function to remove the duplicates

 removeDuplicate(list);

}}

Write a program that removes all non-alpha characters from the given input. Ex: If the input is: -Hello, 1 world$! the output is: Helloworld

Also, this needs to be answered by 11:59 tonight.

Answers

Answer:

Explanation:

The following code is written in Python. It is a function that takes in a string as a parameter, loops through the string and checks if each character is an alpha char. If it is, then it adds it to an output variable and when it is done looping it prints the output variable. A test case has been provided and the output can be seen in the attached image below.

def checkLetters(str):

   output = ''

   for char in str:

       if char.isalpha() == True:

           output += char

   return output

Being the Sales Manager of a company you have to hire more salesperson for the company to expand the sales territory. Kindly suggest an effective Recruitment and Selection Process to HR by explaining the all the stages in detail.

Answers

Answer:

In order to sales company to expand the sales territory in heeds to target those candidates that have long exposure in sales profile.

Explanation:

Going for a sales interview for the profile of a sales manager in a company. The HR department may require you to answer some questions. Such as what do you like most about sales, how to you motivate your team and how much experience do you have. What are philosophies for making sales Thus first round is of initial screening, reference checking, in-depth interview, employ testing, follow up, and making the selection. This helps to eliminate the undesired candidates.

Which tools do you use for LinkedIn automation?

Answers

Explanation:

Automation tools allow applications, businesses, teams or organizations to automate their processes which could be deployment, execution, testing, validation and so on. Automation tools help increase the speed at which processes are being handled with the main aim of reducing human intervention.

Linkedln automation tools are designed to help automate certain processes in Linkedln such as sending broadcast messages, connection requests, page following and other processes with less or no human or manual efforts. Some of these automation tools include;

i. Sales navigator for finding right prospects thereby helping to build and establish trusting relationships with these prospects.

ii. Crystal for providing insights and information about a specified Linkedln profile.

iii. Dripify used by managers for quick onboarding of new team members, assignment of roles and rights and even management of subscription plans.  

Answer:

Well, for me I personally use LinkedCamap to drive more LinkedIn connections, hundreds of leads, sales, and conversions automatically.  

Some other LinkedIn automation tools are;  

   Expandi      Meet Alfred      Phantombuster      WeConnect      LinkedIn Helper  

Hope this helps!

LAB: Count characters - methods
Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in the string.
Ex: If the input is
n Monday
the output is
1
Ex: If the input is
Today is Monday
the output is
0
Ex: If the input is
n it's a sunny day
the output is
0
Your program must define and call the following method that returns the number of times the input character appears in the input string public static int countCharacters (char userChar, String userString)
Note: This is a lab from a previous chapter that now requires the use of a method
LabProgram.java
1 import java.util.Scanner
2
3 public class LabProgram
4
5 /* Define your method here */
6
7 public static void main(String[] args) {
8 Type your code here: * >
9 }
10 }

Answers

Answer:

i hope understand you

mark me brainlist

Explanation:

using namespace std;

#include <iostream>

 

#include <string.h>

#include <stdlib.h>

#include <stdio.h>

 

#define BLANK_CHAR (' ')

 

 

int CountCharacters(char userChar, char * userString)

{

 

int countReturn=0;

 

int n = strlen(userString);

 

for (int iLoop=0; iLoop<n; iLoop++)

{

       if (userString[iLoop]==userChar)

       {

        countReturn++;

 }

}

return(countReturn);

}

 

/******************************************

    Removes white spaces from passed string; returns pointer

     to the string that is stripped of the whitespace chars;

   

  Returns NULL pointer is empty string is passed;  

     Side Effects:

 CALLER MUST FREE THE OUTPUT BUFFER that is returned

 

 **********************************************************/

char * RemoveSpaces(char * userString)

{

 

 char * outbuff = NULL;

 

 if (userString!=NULL)

 {

   int n = strlen(userString);

    outbuff = (char *) malloc(n);

 

   if (outbuff != NULL)

   {

          memset(outbuff,0,n);

          int iIndex=0;

          //copies non-blank chars to outbuff

         for (int iLoop=0; iLoop<n; iLoop++)

         {

           if (userString[iLoop]!=BLANK_CHAR)

          {

           outbuff[iIndex]=userString[iLoop];

           iIndex++;

   }

   

   } //for

         

   }

   

   }

 return(outbuff);

 

}

 

 

int main()

{

 

 char inbuff[255];

 cout << " PLEASE INPUT THE STRING OF WHICH YOU WOULD LIKE TO STRIP WHITESPACE CHARS :>";

 gets(inbuff);

 

 char * outbuff = RemoveSpaces(inbuff);

 if (outbuff !=NULL)

 {

    cout << ">" << outbuff << "<" << endl;

    free(outbuff);

    }

     

   memset(inbuff,0,255);  

   cout << " PLEASE INPUT THE STRING IN WHICH YOU WOULD LIKE TO SEARCH CHAR :>";

gets(inbuff);

 

  char chChar;

 cout << "PLEASE INPUT THE CHARCTER YOU SEEK :>";

 cin >> chChar;

 

 int iCount = CountCharacters(chChar,inbuff);

 cout << " char " << chChar << " appears " << iCount << " time(s) in >" << inbuff << "<" << endl;

 

}

Complete the AscendingAndDescending application so that it asks a user to enter three integers. Display them in ascending and descending order.An example of the program is shown below:Enter an integer... 1 And another... 2 And just one more... 3 Ascending: 1 2 3 Descending: 3 2 1GradingWrite your Java code in the area on the right. Use the Run button to compile and run the code. Clicking the Run Checks button will run pre-configured tests against your code to calculate a grade.Once you are happy with your results, click the Submit button to record your score.

Answers

Answer:

Following are the solution to the given question:

import java.util.Scanner;//import package

public class AscendingAndDescending//defining a class AscendingAndDescending  

{

   public static void main(String[] args) //main method

   {

       int n1,n2,n3,min,max,m;

       Scanner in = new Scanner(System.in);//creating Scanner class object

       System.out.print("Enter an integer: ");//print message

       n1 = in.nextInt();//input value

       System.out.print("And another: ");//print message

       n2 = in.nextInt();//input value

       System.out.print("And just one more: ");//print message

       n3 = in.nextInt();//input value

       min = n1; //use min variable that holds value

       max = n1; //use mix variable that holds value

       if (n2 > max) max = n2;//use if to compare value and hols value in max variable

       if (n3 > max) max = n3;//use if to compare value and hols value in max variable

       if (n2 < min) min = n2;//use if to compare value and hols value in min variable

       if (n3 < min) min = n3;//use if to compare value and hols value in min variable

       m = (n1 + n2 + n3) - (min + max);//defining m variable that arrange value

       System.out.println("Ascending: " + min + " " + m + " " + max);//print Ascending order value

       System.out.println("Descending: " + max + " " + m + " " + min);//print Descending order value

   }

}

Output:

Enter an integer: 8

And another: 9

And just one more: 7

Ascending: 7 8 9

Descending: 9 8 7

Explanation:

In this program inside the main method three integer variable "n1,n2, and n3" is declared that inputs value from the user end and also defines three variable "min, max, and m" that uses the conditional statement that checks inputs value and assigns value according to the ascending and descending order and prints its values.


The part of the computer that provides access to the Internet is the

Answers

Answer:

MODEM

Explanation:

The__________is an HTML tag that provides information on the keywords that represent the contents of a Web page.

Answers

Answer:

Meta tag

Explanation:

let's have a class named Distance having two private data members such as feet(integer), inches(float), one input function to input values to the data members, one Display function to show the distance. The distance 5 feet and 6.4 inches should be displayed as 5’- 6.4”. Then add the two objects of Distance class and then display the result (the + operator should be overloaded). You should also take care of inches if it's more than 12 then the inches should be decremented by 12 and feet to be incremented by 1.

Answers

Answer:

Humildade

Ser justo (Fair Play)

Vencer independente

Describe the operation of IPv6 Neighbor Discovery. ​

Answers

can you give me the link to an article about this so i may help?

Consider the following class in Java:

public class MountainBike extends Bicycle {
public int seatHeight;
public MountainBike(int startHeight,
int startCadence,
int startSpeed,
int startGear) {
super(startCadence, startSpeed, startGear);
seatHeight = startHeight;
}

public void setHeight(int newValue) {
seatHeight = newValue;
}
}
What is this trying to accomplish?

super(startCadence, startSpeed, startGear);

a. Four fields of the MountainBike class are defined: super, startCadence, startSpeed and startGear.
b. The constructor for the parent class is called.
c. A method of the MountainBike class named super is defined.
d. Three fields are defined for the MountainBike class as intances of the class named super.

Answers

Answer:

b. The constructor for the parent class is called.

Explanation:

In this case this specific piece of code is calling the constructor for the parent class. Since a MountainBike object is being created. This creation uses the MountainBike class constructor but since this is a subclass of the Bicycle class, the super() method is calling the parent class constructor and passing the variables startCadence, startSpeed, startGear to that constructor. The Bicycle constructor is the one being called by super() and it will handle what to do with the variables inputs being passed.

Carl is planning for a large advertising campaign his company will unveil. He is concerned that his current e-commerce server farm hosted in a public cloud will be overwhelmed and suffer performance problems. He is researching options to dynamically add capacity to the web server farm to handle the anticipated additional workload. You are brought in to consult with him on his options. What can you recommend as possible solutions

Answers

Answer:

Cloud Bursting

Explanation:

One of the best possible solutions for this scenario would be Cloud Bursting. This is a solution of using Cloud Server services to handle the server farm workload. The difference is that Cloud Bursting allows the company to use the Cloud services only when their own personal web server farms hit peak demand and can no longer handle the incoming demand. The excess demand is outsourced to the Cloud Server and lets them handle it dynamically without the company having to add any additional hardware to their server farm.

What order? (function templates) Define a generic function called CheckOrder() that checks if four items are in ascending, neither, or descending order. The function should return -1 if the items are in ascending order, 0 if the items are unordered, and 1 if the items are in descending order. The program reads four items from input and outputs if the items are ordered. The items can be different types, including integers, strings, characters, or doubles. Ex. If the input is:

Answers

Answer:

Explanation:

The following code was written in Java and creates the generic class to allow you to compare any type of data structure. Three different test cases were used using both integers and strings. The first is an ascending list of integers, the second is a descending list of integers, and the third is an unordered list of strings. The output can be seen in the attached image below.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Order: " + checkOrder(10, 22, 51, 53));

       System.out.println("Order: " + checkOrder(55, 44, 33, 22));

       System.out.println("Order: " + checkOrder("John", " Gabriel", "Daniela", "Zendaya"));

   }

   public static <E extends Comparable<E>> int checkOrder(E var1, E var2, E var3, E var4) {

       E prevVar = var1;

       if (var2.compareTo(prevVar) > 0) {

           prevVar = var2;

       } else {

           if (var3.compareTo(prevVar) < 0) {

               prevVar = var3;

           } else {

               return 0;

           }

           if (var4.compareTo(prevVar) < 0) {

               return 1;

           }  else {

               return 0;

           }

       }

       if (var3.compareTo(prevVar) > 0) {

           prevVar = var3;

       }

       if (var4.compareTo(prevVar) > 0) {

           return -1;

       }

       return 0;

   }

}

14. For the declaration, int a[4] = {1, 2, 3};, which one is right in the following description-
(
A. The meaning of &a[1] and a[1] are same B. The value of a[1] is 1-
C. The value of a[2] is 3
D. The size of a is 12 bytes

Answers

Answer:

A.

thanks later baby HAHAHAHAHAA

Other Questions
3. Sunk Relief:(Plz help) Three functions of educational institution Kkfkfjfkfkfkfkfkfkfkrkri 3. According to the Arrhenius theory, which list of compounds includes only acids?A) HF, H2CO3, and HNO3B) LiOH, HNO3, and CH3OHC) H2PO4, HCO3, and NH4ClD) HNO3, H2SO4, and C6H12O6 Find the value of z such that 0.05 of the area lies to the right of z. Round your answer to two decimal places. Which diagram correctly depicts the trend in electronegativity?a.b.c.d. Poe Company is considering the purchase of new equipment costing $81,500. The projected net cash flows are $36,500 for the first two years and $31,500 for years three and four. The revenue is to be received at the end of each year. The machine has a useful life of 4 years and no salvage value. Poe requires a 10% return on its investments. The present value of an annuity of 1 and present value of an annuity for different periods is presented below. Compute the net present value of the machine. solve the following problems Which operating system desktop or mobile is the best Evolutionary theorists have suggested that human beings may have a natural aversion to bitter tastes because many lethal poisons have a bitter flavor. This natural ability to learn an association for biological reasons is called ______. a. preparedness b. stimulus discrimination c. blocking d. a learned aversion e. instinctive drift 1) Convert the following:I) 65 kg into gii) 87570 seconds into houriii) 7.5 km into m /*Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region .For example,X X X XX O O XX X O XX O X XAfter running your function, the board should be:X X X XX X X XX X X XX O X X*/public class Solution { // This algorithm cannot solve the large test set public void solve(char[][] board) { // Start typing your Java solution below // DO NOT write main() function int rows = board.length; if(rows == 0) return; int cols = board[0].length; for(int i = 0; i < cols; i++) { // check first row's O if(board[0][i] == 'O') { // change it to other symbol board[0][i] = '#'; dfs(board, 0, i); } // check the last row if(board[rows - 1][i] == 'O') { board[rows - 1][i] = '#'; dfs(board, rows - 1, i); } } for(int i = 0; i < rows; i++) { // check first col if(board[i][0] == 'O') { board[i][0] = '#'; dfs(board, i, 0); } // check last col if(board[i][cols - 1] == 'O') { board[i][cols - 1] = '#'; dfs(board, i, cols - 1); } } // change O to X changeTo(board, 'O', 'X'); // change # to O changeTo(board, '#', 'O'); return; } public void dfs(char[][] board, int row, int col) { // check up if(row > 0) { if(board[row - 1][col] == 'O') { board[row - 1][col] = '#'; dfs(board, row - 1, col); } } // check left if(col > 0) { if(board[row][col - 1] == 'O') { board[row][col - 1] = '#'; dfs(board, row, col - 1); } } // check right if(row < board.length - 1) { if(board[row + 1][col] == 'O') { board[row+1][col] = '#'; dfs(board, row+1, col); } } // check down if(col < board[0].length - 1) { if(board[row][col+1] == 'O'){ board[row][col+1] = '#'; dfs(board, row, col+1); } } return; } public void changeTo(char[][] board, char from, char to) { for(int i = 0; i < board.length; i++) { for(int j = 0; j < board[0].length; j++) { if(board[i][j] == from) { board[i][j] = to; } } } return; }} Solve for F (15 Points) Can someone help me with this plsWhich of the following results in agglutination? (1) similar blood types being mixed (2) the separation of blood cells from plasma (3) antigens reacting to other antigens (4) antibodies reacting to foreign antigens (5) the donation of blood to a blood bank Which of the following was a criticism of the New Deala)It reformed the government and decrease spendingb)It created schools and protected farmersc)It increased spending on defense and traded)It gave too much power to the government Find the measurement of D and C If f(n) = 4n + 7 and g(n) = 2n + 3, find (g - f)(n). 2(n-4)4- 2n-2n - 42n + 4 When you go to the Writing Center, which of the following is part of the advisors job? How can an Outlook user search for contacts? Check all that apply.the Search bar located above the list of contactsthe Search People bar on the Find command groupthe Search People located on the People navigation iconCTL + E to activate the search contacts boxadvanced Find under the Search tabthe options menu in the backstage view A car with a passenger of mass 56 kg can travel a distance of 120 km using 10 l of petrol. If the number of passengers increases to 4 people with a total mass of 224 kg, the distance travelled decreases by 10%. What is the total distance that the car carrying 4 passengers can travel using 10 l of petrol?