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
Maurinko [17]
3 years ago
15

You are given two arrays of integers a and b of the same length, and an integer k . We will be iterating through array a from le

ft to right, and simultaneously through array b from right to left, and looking at pairs (x, y), where x is from a and y is from b Such a pair is called tiny if the concatenation xy is strictly less than k. Your task is to return the number of tiny pairs that you'll encounter during the simultaneous iteration through a and b.
Computers and Technology
1 answer:
rodikova [14]3 years ago
4 0

Answer:

#include <iostream>

using namespace std;

int main(){

   int arr1[5], arr2[5], k = 7;

   arr1 = {1,3,5,3,6}

   arr2 = {1,3,2,4,4}

   int reverseA2[5];

   for (int x = 5; x > 0; x++){

       reverseA2[5-x] = arr2[x-1];

   }

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

       if ( arr1[i] + reverseA2[i] < k){

           cout<< arr1[i] << " , "<<reverseA2[i];

       }

   }

}

Explanation:

The C++ source code prints a pair of values from the arr1 and reverse arr2 arrays whose sum is less than the value of the integer variable value k.

You might be interested in
What are examples of data duplication in flat files? Check all that apply.
photoshop1234 [79]

Answer:

Flat file databases are databases that are contained in one single table, or in the form ... -Data Redundancy, By having a relational database it ensures that no attributes ... There are only three different 'degrees' of relationship between two entities. ... Consider, for example, the link between customers, orders and products.).

Explanation:

7 0
3 years ago
Read 2 more answers
Which of the following demonstrates the proper way to specify a variable-length argument list?
larisa86 [58]

Answer:

The answer to this question is option "d".

Explanation:

In the given question option d is correct because variable-length argument is a new feature in J2SE 5.0 which stands for java 2 standard edition and 5.0 is the version name. It is the variable-length argument lists. A coder can create functions that uses a function to receive several parameter that is not specified. An argument type followed by an ellipsis(...) in the parameter list of a method means that a fixed number of arguments of that particular type is obtained by the method. and other options are not correct that can be given as:

  • In option a, we do not need to use the string the variable-length argument list. That's why it is wrong.
  • The option b and c are all wrong because in the last parameter the variable-length argument list is used.

That's why the answer to this question is the option "d".

7 0
3 years ago
Define and use in your program the following functions to make your code more modular: convert_str_to_numeric_list - takes an in
Lelechka [254]

Answer:

In Python:

def convert_str_to_numeric_list(teststr):

   nums = []

   res = teststr.split()

   for x in res:

       if x.isdecimal():

           nums.append(int(x))

       else:

           nums = []

           break;

   return nums

def get_avg(mylist):

   if not len(mylist) == 0:

       total = 0

       for i in mylist:

           total+=i

       ave = total/len(mylist)

   else:

       ave = "None"

   return ave

def get_min(mylist):

   if not len(mylist) == 0:

       minm = min(mylist)

   else:

       minm = "None"

   return minm

def get_max(mylist):

   if not len(mylist) == 0:

       maxm = max(mylist)

   else:

       maxm = "None"

   return maxm

mystr = input("Enter a string: ")

mylist = convert_str_to_numeric_list(mystr)

print("List: "+str(mylist))

print("Average: "+str(get_avg(mylist)))

print("Minimum: "+str(get_min(mylist)))

print("Maximum: "+str(get_max(mylist)))

Explanation:

<em>See attachment for complete program where I use comment for line by line explanation</em>

Download txt
7 0
3 years ago
The output of a combiner is normally fed into a
ankoles [38]

The output of a combiner is normally fed into a mask filter. Check more about output below.

<h3>What is output?</h3>

Output is known to be that which is gotten from the act of making of anything or the amount of a thing that is processed.

Note that he output of a combiner is normally fed into a mask filter as it is the first point of contact.

Learn more about output  from

brainly.com/question/20727977

#SPJ2

7 0
2 years ago
Read 2 more answers
They are correct? thank you!
SashulF [63]

Answer:

YES IT IS RIGHT ANSWER

Explanation:

WELCOME :)

3 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is where you can save, select a template, change document properties, and close or exit excel?
    8·1 answer
  • The Joint Photographic Experts Group developed the ___________ graphic format.
    12·2 answers
  • You must obey any special signs or instructions as you pass a construction zone.
    14·2 answers
  • escribe and explain at least three improvements you think came about with the introduction of intrusion prevention technology. J
    10·1 answer
  • What is the purpose of interrupts? How does an interrupt differ from a trap? Can traps be generated intentionally by a user prog
    11·1 answer
  • The integrity of a program's output is only as good as the integrity of its input. For this reason, the program should discard i
    6·1 answer
  • Which statement best describes the difference between a spreadsheet and a database?
    9·2 answers
  • Select the correct answer.
    5·1 answer
  • To read cheques, banks use​
    11·1 answer
  • Which option is designed by software engineers?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!