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
abruzzese [7]
2 years ago
11

We informally define the term corresponding element as follows: The first element in an array and the last element of the array

are corresponding elements. Similarly, the second element and the element just before the last element are corresponding elements. The third element and the element just before the element just before the last element are corresponding elements -- and so on. Given an array a, write an expression for the corresponding element of a[i].
Computers and Technology
1 answer:
yanalaym [24]2 years ago
7 0

The corresponding element in an array can be written as follows.

The given array is arr[len] whose size is given by integer variable len. We take another integer variable k.

Corresponding element for arr[k] = arr[len-1-k]

This applies for all expressions of k beginning from 0 upto half the size of len, i.e., len/2.

For element, arr[0], the corresponding element is arr[10-1-0] = arr[9].

The above expression is valid if the sum of index of both element and its corresponding element adds upto the index of the last element of the array.

Example: k + (len – 1 - k)  

= k + len – 1 - k

= len – 1

= index of the last element of the array

The number of elements that an array can hold is one more than the index of the last element of the array.

Suppose an array of 10 elements is given. The above expression holds true since first element of the array is always written as arr[0] and last element will be written as arr[9] for an array of 10 elements.

This is illustrated below.

The c++ program to display the element and its corresponding element along with their index is shown below.

#include <iostream>

using namespace std;

int main() {    

   int len=10, arr[len],k;    

   for(k=0; k<len; k++)

   {

       // elements are initialized to twice their index

       arr[k] = k*2;

   }

   cout<<"Element "<<" Index "<<"\t"<<" Corresponding "<<" Index"<<endl;

   for(k=0; k<len/2; k++)

   {

       cout<<arr[k]<<"\t"<<"\t"<<"\t"<<k<<"\t"<<"\t"<<"\t"<<arr[len-1-k]<<"\t"<<"\t"<<len-1-k<<endl;

   }

}

OUTPUT

Element Index    Corresponding   Index

0  0   18  9

2  1   16  8

4  2   14  7

6  3   12  6

8  4   10  5

 

The above program initializes all the elements of the array to twice the value of their corresponding index. Following this, the element, its index, the corresponding element and its index is displayed.

All the above is achieved using for loop. The size of the array and its elements can be changed.

The expression for the corresponding element is thus explained.

You might be interested in
Name at least TWO kinds of gaming experiences that are possible with these new control devices but were not possible on original
Pie

Yes the ansewer is c bc you can look it up!


6 0
2 years ago
An open system consists of nonproprietary hardware and software based on publicly known standards that allows third parties to c
kolezko [41]

Answer:

The answer is "Option D".

Explanation:

A system or a group of components that communicate with your environment through the sharing of resources, materials, and knowledge with a view to system regeneration and development is known as an Open system. In other words, we can say that it is a system that includes a non-proprietary hardware and advert-based software which enables third parties to add or interact with products to plug in the system and It is freely available on the internet. In this question, the incorrect options can be described as follows:

  • In option A, The management system is used by an organization. It is a paid system that's why it is not correct.
  • In option B, This system enables users in online communities and evaluates one another that's why it is not correct.
  • In option C, This type of system provides resources for upgrade user knowledge. It is a paid system that's why it is not correct.  

6 0
2 years ago
A _____ system allows a customer to request a fax using email, via the company website, or by telephone.
balu736 [363]

A faxback system allows a customer to request a fax using email, via the company website, or by telephone.

<h3>What is faxback?</h3>

Faxback (usually uncountable, plural faxback) An interactive electronic service permitting documents to be downloaded via fax machine. FaxBack searches a pre-assigned database to validate numerals provided while at the same time recovering a caller's name and fax number. Callers without an account can hear a message in- structing them on how to receive an account or be given the option of furnishing a credit card.

FaxBack Fax Machine Solutions add features to the fax machine equivalent to how VoIP added components to the phone: receive fax notification via email and track, archive, and manage faxes via the fax server or service provider control panel.

Hence, A faxback system allows a customer to request a fax using email, via the company website, or by telephone.

To learn more about faxback refer to:

brainly.com/question/13735750

#SPJ4

4 0
8 months ago
One of the jobs of the webmaster are to create a website<br>true or false
Talja [164]

true is the correct answer

8 0
2 years ago
Read 2 more answers
When is a wired connection preferred to a wireless connection by an end-user device?
harkovskaia [24]

Answer:

Option (b) When the end-user device will run an application that requires a dedicated connection to the network

Explanation:

  • Option (b) is the correct option.
  • When the user device requires a highly dedicated network environment to itself to run a web application that requires large download and upload speeds, bandwidth requirements then it prefers a wired connection than a wireless connection.
  • If the wireless signal is within the reach, then it advisable to go for a wireless connection than a wired connection. A wired connection requires other hardware equipments like a internet connection cable etc. which is not required in case of wireless connection. So, option (a) is wrong option.
  • WLAN NIC is a wireless interface network controller that connects to a wireless radio based network than a wired network.So, option (c) is wrong option.
  • Delay torrent network is designed to operate where continuous network connectivity is not available like extreme terrestrial spaces, space communications, inter planetary communications etc.So, option (d) is wrong option.
6 0
2 years ago
Other questions:
  • The automotive system that connects the engine and the transmission to the wheels is called the
    14·1 answer
  • What would happen if you clicked on the Show Desktop icon on your computer screen? The system tray would appear. All open window
    9·2 answers
  • A specially formatted encrypted message that validates the information the CA requires to issue a digital certificate is known a
    6·1 answer
  • Go online and research the computer topic
    6·1 answer
  • Complete the following statement: Sustainability is: Choose all that apply.This task contains the radio buttons and checkboxes f
    10·1 answer
  • . How to insert Section Break in Microsoft word 2016 ?
    14·1 answer
  • Question # 1
    12·2 answers
  • What explains the discrepancy between the number of bytes you can
    13·1 answer
  • Could anyone help me with this assignment please?
    6·1 answer
  • Which term refers to the use of the internet at work for personal use?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!