C programming language questions

Assignment Help Business Management
Reference no: EM132400899

C programming language questions:

Consider the function below, which has two arguments but otherwise has no local variables.

void f(int *a, int *b)
{
    *a = *a ^ *b;
    *b = *a ^ *b;
    *a = *a ^ *b;
}
  1. If, per this function's declaration, each of a and b is the address of an int, exactly what does this function do to *a and *b, the values at those addresses? (Consider, for instance, if *a is 1 and *b is 2.) Put another way, what would be a better name for this function than f?

Backups

XOR can also be used to back up your data! Suppose that your computer has just one drive on which to store files. If that drive were to fail, you could lose all of your data. Having a second drive with copies of your files as a backup would be better. But suppose that you have so many files that you need that second drive for more storage. Backing up both drives would seem to require two more drives for a total of four. But not so with XOR! Thanks to XOR, you can save a bit of space (and money!) by buying just one additional drive, for a total of three. But instead of storing files on that third drive, you can instead store the XOR of your other two drives. If any of those three drives fail, you can recover its bits by XORing the other two drives onto a new drive.

For the sake of discussion, suppose that these drives are not very large. They can each store, say, only 8 bits. (You should have shopped around.) Suppose that the first drive contains 11110000 and the second drive contains 00011000. You should thus store 11101000 on your third drive because:

  11110000
^ 00011000
  --------
  11101000
  1. Suppose that one of your three drives fails and, before you have time to XOR your remaining two drives onto a new third drive, one of your remaining two drives fails as well. What might the effect be on your files?
  2. Suppose that you now have not two but three hard drives with files that you'd like to back up, such that if any one of the three drives fails you'd like to be able to recover the data. How many additional drives do you minimally need? And what would you store on the additional drive(s)?

Reference no: EM132400899

Questions Cloud

Discuss techniques that you can use to identify risks : Discuss techniques that you can use to identify risks. Why is it important to think about risks?
Topic is important for your peers to understand : Explaining why this topic is important for your peers to understand. Be focused and specific.
What is the difference between cyber warfare : What is the difference between cyber warfare and cyber espionage and what can have a larger, long-term impact?
Improve competitive advantage and decision making : List and explain four ways in which hypothesis testing using big data can improve competitive advantage and decision making for businesses.
C programming language questions : Consider the function below, which has two arguments but otherwise has no local variables.
Create a detailed summary statistics table for the variable : Create a detailed summary statistics table for the variable "rtrip_fare". What is the mean of the variable? What is the median
Leadership best practices for creating corporate culture : Synthesis of leadership best practices for creating a corporate culture that supports effective strategy execution and implementation.
Global leadership is term that may be confusing in scope : Global leadership is a term that may be confusing in its scope. For some, global leadership may mean anything from a domestic executive whose job description
Competitive advantage and decision making for businesses : List and explain four ways in which hypothesis testing using big data can improve competitive advantage and decision making for businesses.

Reviews

Write a Review

Business Management Questions & Answers

  When an aggregate demand shock ends

When an aggregate demand shock ends, the AD curve will return to its original position, obeying the principle of transition dynamics (True or False)

  Important information about identify one modern technology

Find one modern technology and discuss how this technology has changed the way you live from both a positive and negative perspective?

  Qualifications organizational structure

You will use the same business that you used in your Unit 1 assignment! (COMCAST) Insert a cover page that includes the title of your report

  What you believe will biggest challenges facing organization

In this assignment, you will create a PowerPoint presentation that outlines what you believe will be the biggest challenges facing organizations in the next twenty years.

  Explain how employment law was applied in the resolution

Select a past or current issue in employment law in the United States. Describe the issue. Explain how employment law was applied in the resolution.

  Removal of a pleasant consequence contingent

Does negative reinforcement eliminate undesirable behavior by making the removal of a pleasant consequence contingent on its occurrence.

  Blockchain will do to the financial system

In the case study "The Blockchain Will Do to the Financial System What the Internet Did to Media" by Joichi Ito, Identify the core problems in the case in depth

  Post an initial substantive response

1. Post an initial substantive response of 200- 250 words to each question. 2. References and citations should conform to the APA 6th edition.

  Question 1theoretically modigliani and miller 1958 took a

question 1theoretically modigliani and miller 1958 took a fairly straightforward view of the purpose of a company in an

  Describe the uses of business forecasting

Prepare a paper that describes the uses of business forecasting. Must use APA style formatting and list references.

  How would documentation of the promise change

Car Dealer, Inc. enters an enforceable contract to sell a car to Buyer for $20,000. The car has not yet been delivered when Buyer incurs a large unexpected.

  Briefly summarize the organization primary product

Organization Overview: Briefly summarize the organization's primary product or service. What is the organization's current focus? What are the organization's overarching goals

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd