You are given two sorted arrays, A and B, and A has a large enough buffer at the end to hold B. Write a method to merge B into A in sorted order without using any other array space.Implementation instruction:1) Define one array of size 18 for A and the other array of size 5 for B.2) Initialize A by inputting 13 integers in the ascending order, and Initialize B by inputting 5 integers in the ascending order.

Answers

Answer 1

Answer:

#include <iostream>

using namespace std;

int main(){

   int arrayA[18] = {1,2,3,4,5,6,7,8,9,10,11,12,13};

   int n = arrayA.length();

   int arrayB[5] = {14,15,16,17,18};

   for (int i = 0; i < arrayB.length(); i++){

       arrayA[n] = array[i];

       n++;

   }

}

Explanation:

The C++ program defines two arrays namely; "arrayA" and "arrayB". The first array has a space size of 18 while the second array has a size of 5. In the program, the second array is merged into the first array


Related Questions

Is there anyone who is very good with Microsoft access? ​

Answers

Answer:

na i can boot people offline

Explanation:

Write down the pseudo code for a brute-force algorithm to compare elements in array A with elements in array B.

Answers

Answer:

def brute_force(array1, array2):

   for item in array1:

       for element in array 2:

           if element == item:

               print(f"{element} and {item} are a match")

Explanation:

A brute-force algorithm is a direct-to-solution algorithm that searches and compares variables. It is like trying to unlock a safe but not knowing its four-digit combination, brute-force starts from 0000 through 9999 to get a match.

The python program implements the algorithm using two nested for loops. The first loop iterates over array1 while the second, over array2. For every item in the first array, the program loops through the length of the second array. For every match, the items are printed on the screen.

Write a while loop that prints user_num divided by 2 until user_num is less than 1. The value of user_num changes inside of the loop. Sample output for the given program:

Answers

user_num = 20

while user_num>= 1:

   print(user_num,"divided by 2 =",user_num/2)

   user_num /= 2

I wrote my code in python 3.8. I hope this helps.

Answer:

user_num = int(input())

while user_num>= 1:

  print(user_num/2)

  user_num /= 2

Explanation:

Simplified it

The create_python_script function creates a new python script in the current working directory, adds the line of comments to it declared by the 'comments' variable, and returns the size of the new file. Fill in the gaps to create a script called "program.py". 1- def create_python_script(filename): 2 comments = "# Start of a new Python program" with open("filename", "w+") as file: file.write(comments) import os filesize - os.path.getsize(filename) print("The size of the file is:") return(filesize) Reset 3 4 5 6 7 Run 9 10 11 print(create python script("progran.py"))

Answers

Answer:

import os

def create_python_script(filename):

   comments = "# new python script file"

   with open(filename,"w+") as file:

       file.write(comments)

   filesize = os.path.getsize(filename)

   print(f"The size of the file is: {filesize}")

create_python_script("program.py")

Explanation:

The os module is a built-in python file that is used to interact with the operating system terminal. The with keyword is used to create and open a file with write privileges with no need to close the file.

The path.getsize() method is used to get the size of the newly created file which is printed in the console.

A group of students is performing an investigation to measure how much liquid water is produced from a 10 L sample of snow. What must occur in order for the students to perform this investigation?

Answers

Answer:

the temperature of the sample must change

Explanation:

Identify some cases of violations of user privacy from current literature and their impact on data science as a profession.

Answers

Explanation:

Remember, the term "violations of user privacy" is usually used when an entity without seeking users' consent uses or sells the private information of people (or users) in a way the users would view as inappropriate.

For example, in 2020, one of Mark Zuckerberg's company was recently accused of secretly watching its user who had the app installed on their phone via their smartphone front camera without their knowledge.

Another prominent case is that of ride-sharing company Uber, in 2018, they were accused of not taking seriously the protection of users privacy after they've experienced a data breach that exposed their customer's personal information, such as phone numbers, addresses, and email addresses. They were penalized as result by a court.

Which situation would benefit most from a Watch window?
A B C D
the answer is: D. A 3-D formula causes cells in a worksheet to change when edits are made to other worksheets.

Answers

Answer:

yeah i agree with your answer

Answer:

D) A 3-D formula causes cells in a worksheet to change when edits are made to other worksheet  

Explanation:

;)

In ANSI standard C(1989) code - this is what we are teaching- declarations can occur in a for statementas in
for(int i;i<10; i++0.
True
O
False​

Answers

Answer:

true is the answer to this

What do search engines use to trust that a local business is an appropriate place for which users are looking?​

Answers

Answer:

To build trust among search engines, authority needs to be demonstrated not just in a website's content, but how the site is perceived by other authoritative sites. ... Garnering links from authoritative sites like social networks, directories and other sources will improve trust.

As a sysadmin you will find yourself doing business with a variety of third party vendors which of these are likely to be rented or bought from a vendors

Answers

Answer:

Printing devices

Video, Audio devices

Communication machines

Explanation:

Printing devices - Sysadmin needs this type of devices for print important data and information.

Video, Audio devices - Sysadmin needs this type of devices for better communication and interaction.

Communication(fax) machines - Sysadmin needs this type of devices for written communication and interaction and deals.

Write a program that reads a string from the user containing a date in the form mm/dd/yyyy. If the user entered 12/10/2019, then it should print the date in the form December 10, 2019. solution in python.

Answers

Answer:

months = ["January","February","March","April","May","June","July","August","September","October","November","December"]

date = input("mm/dd/yyyy: ")

splitdate = date.split("/")

print(months[int(splitdate[0])-1]+" "+splitdate[1]+", "+splitdate[2]+".")

Explanation:

This line initializes a list of all 12 months

months = ["January","February","March","April","May","June","July","August","September","October","November","December"]

This prompts the user for date

date = input("mm/dd/yyyy: ")

This splits the date into three parts; mm with index 0, dd with index 1 and yy with index 2

splitdate = date.split("/")

The following prints the required output

print(months[int(splitdate[0])-1]+" "+splitdate[1]+", "+splitdate[2]+".")

Analyzing the print statment

splitdate[1] represents the day of the date

splitdate[2] represente the month of the date

However, in months[int(splitdate[0])-1]

First: splitdate[0] represents the month of the year as a string in numeric form e.g. "12", "01"

It is first converted to an integer as: int(splitdate[0])

Then the corresponding month is derived from the month list

What are the similarities and differences between the editor-in-chief, managing editor, assignment editor, and copyeditor? Your response should be at least 150 words.

Answers

Answer:

Editor. An editor is the individual in charge of a single publication. It is their responsibility to make sure that the publication performs to the best of its ability and in the context of competition. A managing editor performs a similar role, but with greater responsibility for the business of the publication.

Explanation:

a character that
is raised and smaller above the baseline is called​

Answers

Answer:

A character that  is raised and smaller above the baseline is called​ a superscript.

Explanation:

A character that  is raised and smaller above the baseline is called​ a superscript.

For example, let 'a' be the number and 'n' is the exponent power of the number 3.

aⁿ

The number 'n' above the number 'a' is an example of a superscript.

In another example, let the expression be

4⁶

The number 6 above the number 4 is an example of a superscript.

Therefore, we conclude that a character that  is raised and smaller above the baseline is called​ a superscript.

Application software helps run the computer and coordinates instructions with the hardware.
A. True
B. False

Answers

Answer:

A. True

Explanation:

Several key people were involved in programming-language development in the 1970s and 1980s

Answers

Answer:

Brian Kernighan and Dennis Ritchie created the C programming language, and Bjarne Stroustrup took it to the next level by creating C++ in the 80's.

Answer:

Bjarne Stroustrup released C++ programming language in the1980s.

Bill Gates and Paul Allen released the first programming language for a personal computer.

Niklaus Wirth developed Pascal to teach programming.

Explanation:

1,3,4

Write a function contains_at() that accepts two sequences (e.g., lists, strings, etc), s and q, and an integer p

Answers

Answer:

Following are the method to this question:

def contains_at (s, q, p):#defining a method contains_at that accepts a list string and an integer.  

Explanation:

In the above-given question, some of the data missing, that's why we define this question as follows:

program for the above the given method:

def contains_at (s, q, p):#defining a method contains_at

   return s,q,p #use return keyword to return parameter value

s="data base"#defining string variable

q=[1,2,3,4,5]#defining a list  

p=3#defining integer variable  

print(contains_at(s,q,p))#use print method to call contains_at method

Output:

('data base', [1, 2, 3, 4, 5], 3)

In the above program, a method contains_at  is declared, which accepts a list, string, and an integer value in its parameters, and use the return keyword to return the above parameter value.

In the next step, a parameter variable is declared, which accepts a value, and use a print method to call the method.

On a flowchart, what does an oval represent?

a
output

b
process

c
start or stop

d
input

Answers

On a flowchart, start or stop does an oval represent.

what are major classification of computer software​

Answers

Answer:

Application Software.

System Software.

Programming Software.

While application software is designed for end-users, and system software is designed for computers or mobile devices, programming software is for computer programmers and developers who are writing code.

Driver Software.

Explanation:

Typically, there are two major classifications of software, namely System Software and Application Software.

1. System Software

A system software aids the user and the hardware to function and interact with each other. Basically, it is a software to manage computer hardware behavior so as to provide basic functionalities that are required by the user. In simple words, we can say that system software is an intermediator or a middle layer between the user and the hardware. These computer software sanction a platform or environment for the other software to work in. This is the reason why system software is very important in managing the entire computer system. When you first turn on the computer, it is the system software that gets initialized and gets loaded in the memory of the system. The system software runs in the background and is not used by the end-users. This is the reason why system software is also known as ‘low-level software’.Some common system software examples are:

Operating SystemDevice DriversFirmwareProgramming Language TranslatorsUtility

2. Application Software

Application Software, also known as end-user programs or productivity programs are software that helps the user in completing tasks such as doing online research, jotting down notes, setting an alarm, designing graphics, keeping an account log, doing calculations or even playing games. They lie above the system software. Unlike system software, they are used by the end-user and are specific in their functionality or tasks and do the job that they are designed to do. For example, a browser is an application designed specifically for browsing the internet or MS Powerpoint is an application used specifically for making presentations. Application Software or simply apps can also be referred to as non-essential software as their requirement is highly subjective and their absence does not affect the functioning of the system. All the apps that we see on our mobile phones are also examples of Application Software. There is certain software that is exclusively made for app development like Meteor and Flutter. These are examples of Application software too.There are various types of application software:

Word ProcessorsDatabase SoftwareMultimedia SoftwareEducation and Reference SoftwareGraphics SoftwareWeb Browsers

Other than these, all the software that serves a specific purpose fall under the category of Application Software.

However, there exists one more classification of the software. The software can also be classified based on their availability and sharability.

HOPE IT HELPS

PLEASE MARK ME BRAINLIEST ☺️

In reviewed assignment, you will use an array to calculate an average from raw data.

a. True
b. False

Answers

Answer:

a. True

Explanation:

In C, an array is a data structure used to hold a collection of similar data types. It is ordered and indexed, which means that it can be accessed using the index value of the target item in the array.

A loop statement can be used to iterate over all the items in the array. For example, you can get the average of all the items in an integer array by iterating over it, summing its total and dividing it by the length of the array.

Please help me I am crying because I don't know
Small computer systems interface and Universal serial bus ports are examples of _____ device Sports

Answers

Answer:ubers texi’s

Explanation:

Which of the following is not an example of Detailed Demographics?
Car ownership status
Homeownership status
Marital status
Parenting stages?

Answers

Answer:

Car ownership status.

Explanation:

While the rest have detailed demographics, demographics of car buyers are, by brand. A detailed demographic of a car ownership 'status' sounds ridiculous.

Compare briefly the general structure of the complete language processor of Java and the language processor of C . (b) Explain the major differences.

Answers

Answer:

The difference to this question can be defined as follows:

Explanation:

Java language processor:

In java, it uses both compiler and interpreter.It uses high-level data is translated by java computer to byte-code, and by this, it transfers to an element, through either java interpreter or the Just-in-time, into electronic format Just-in-time compiler optimizations are generally preferred to the interpretation so because the process is slowed down. Its state of development of java bytecode is moderate (this byte code can run on any machine, on any operating system), therefore JAVA is an independent platform language.

C++ language processor:

In C++, it uses the only compiler. The software is preserved with the .cpp extension. so, that it can be converted to allelopathy of the c++ COMPILER, high - level language. The creation of the byte code is no intermediary, and it is not an independent platform.

Observe the following output and write the complete HTML-CSS code to generate it:

Answers

Answer:

HTML:

<ol start="3">

 <li>English</li>

 <li>Maths</li>

 <li>Physics</li>

 <li>Chemistry</li>

 <li>Biology</li>

</ol>

CSS:

ol {

 color: green;

 font-family: Courier;

 list-style-type: lower-roman;

 border: 2px dotted black;

 width: 200px;

}

li {

 margin-left: 10px;

}

Explanation:

The left margin on the li is not very clean, but it prevents the roman numbers from exceeding the border.

HELP!!! What would var d=?

Answers

Answer:

51015

Explanation:

Var b is a string, and it'll treat addition like string concatenation (aka just adding a message.) Since it's concatenation, it'll then turn the numbers/integers into strings.

This kind of behavior might be different depending on the language, though. Some languages might not allow this. (For example, C and C++)

Bob is having no luck performing a penetration test on Retail Store's network. He is running the test from home and has downloaded every security scanner that he could lay his hands on. Despite knowing the IP range of all the systems, and the exact network configuration, Bob is unable to get any useful results. Why is Bob having these problems?

Answers

Incomplete question. The full question read;

Why is Jim having these problems?

Options:

A. Security scanners are not designed to do testing through a firewall.

B. Security scanners cannot perform vulnerability linkage.

C. Security scanners are only as smart as their database and cannot find unpublished vulnerabilities.

D. All of the above.

Answer:

D. All of the above.

Explanation:

Remember, security scanners are only designed to gather information about a network, but not with the ability to perform firewall testing. Also, these security scanners are pre-programmed with existing vulnerabilities in their database, and so it would impossible to discover vulnerabilities on the Retail store's network.

Hence, since Bob is using the wrong tools, he is unsuccessful in performing a penetration test.

which data representation system is based on the digits 0-9 and is mostly easily interpreted In real wrold situations​

Answers

Answer:

Hexadecimal  data representation system is based on the digits 0-9 and is mostly easily interpreted In real word situations​ .

Explanation:

Hexadecimal manages sixteen different figures: most often the numbers 0–9 to describe values zero to nine, and (A–F) to describe values ten to fifteen. The modern hexadecimal system was first launched into the domain of computing by IBM in 1963. An older description, with 0-9 and u-z, was practiced in 1956 by the Bendix G-15 computer.

Game Informer (often abbreviated to GI) is an American-based monthly magazine featuring articles, news, strategy, and reviews of popular video games and associated consoles. Formed in August 1991,[1] the magazine has nearly 3 million subscribers according to Andrew Reiner, making it the highest circulated video game magazine,[2] and as of the first quarter of 2007, it is listed as the 23rd largest overall magazine. Game Informer is now ranked among the top four magazines for reaching males 18 to 34.[3] It is owned and published by GameStop Corp., the parent company of the video game retailer of the same name. Due to this, a large amount of promotion is done in-store, which has contributed heavily to its large subscription base,[4] especially as a subscription is included with the store's Gamer's Edge discount card. Contents [hide] · · 1 GI Staff · · 2 Recurring events · · 3 Reviews · · 4 Website · · 5 References · · 6 External links Judging from this introduction, what kind of information would you expect to find in the article? a. How many people subscribe to Game Informer c. A list of games about which Game Informer has written b. Who works for Game Informer d. none of the above

Answers

Answer:

it is d i just took it

Explanation:

There is not any kind of information would you expect to find in the article, hence option d is correct.

What is information?

Information is defined as a vague idea that describes something with the capacity to inform. Information is most fundamentally concerned with the interpretation of what may be sensed. Facts and text elements including a glossary, table of contents, photographs, and captions are characteristics of informational literature.

Game Informer is a consumer advocate who aims to assist gamers in finding games they will enjoy, and it has built a solid reputation for reliable reviews and clear, succinct reporting by an experienced staff. You can access both the PC/Mac browser version of Game Informer as well as the Game Informer app for iOS or Android with a single digital subscription.

Thus, there is not any kind of information would you expect to find in the article, hence option d is correct.

To learn more about information, refer to the link below:

https://brainly.com/question/13629038

#SPJ2

HURRY HELP
A program contains an if statement followed by an else statement. When the condition in an if statement is met, what happens to the code that follows the else statement ?
it is a name error
it is a syntax error
it is ignored
it is executed

Answers

Answer:

Explanation:

syntax error - with this error the code cannot be executed, its a crucial error within the code

name error - misspell an identifier name, will stop the code from running

ignore error - could be something like grammar ignored, wont stop the code running

executed - it will crash the whole code stopping it from running if it involved any of the errors above

Answer:

it is ingnored because the if statemeant has been met

Explanation:

What is one way polymorphism is implemented?


created a new class using an existing class

changing a variable from a string to a float

hiding class variables from the programs using instances of the class

repurposing an operation

Answers

Answer:

repurposing an operation

Explanation:

Got it right

Write a program that opens an output file with the filename my_name.txt, writes your name to the file, then closes the file. python

Answers

f = open("my_name.txt", "w")

f.write("Your name here")

f.close()

You just have to change Your name here to your actual name. I wrote my code in python 3.8. I hope this helps.

Other Questions
Lorenzo wants to buy a guitar. The original price is $70. What is the sale price? Which statement compares how the euglena and volvox obtain food? Explain the spread of Christianity in Africa or India.( 5-7 sentences) an object with a mass of 300 kg is observed to accelerate at the rate os 4m/s what is the total force required 1. Silk weaving or textiles in Southeast Asia now provides employment for many ruralwomen,A. The statement is correct,B. The statement is incorrect.C. The statement is related to silk weaving.D. The statement is not related to silk weaving. All tickets to a play have the same cost. A group bought 6 tickets and paid a total of $99. Write a multiplication equation that can be used to determine cost c in dollars for each ticket. During the period from 2007 to 2017 Bs there was foreign interest in the politics of Nepal? Justify the statement Which of the tables represents a function? (5 points)Table AInputs Output313423Table BInputOutput275629Table CInputOutput157273Table DInputOutput341585Group of answer choicesTable CTable DTable ATable B It Costs $4 to skate each hour and there is a one-time fee of $5 for the skate rental. Which expression represents the cost to skate for someone who has to rent skates? Need help!! Please!! Offering 20 points! Landon bought a tray of plants for $8.15. There were 16 plants in the tray. If Landon only bought 1 plant, about how much would it have cost? True or false: The drug Salvarsan was used as treatment for syphilis in the early twentieth century. How did President Lincoln stop foreign goods and aid from entering the south during the civil war? In what political office did Aaron Henry serve? Materials that allow the charges of an electric current to move freely through them are called a. Insulators. B. Conductors. C. Resistors. D. Magnets. Y = [ ? ]PLEASE HELP pls help me figure this out!!! quick!! Can anyone explain this to me? Is the following fraction terminating or repeating? *-3__7TerminatingRepeating This question is just for my General Knowledge...Who is frist teacher in this world?:) Steam Workshop Downloader