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

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

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