Compute and return the number of strings of a as and b bs

Assignment Help Computer Engineering
Reference no: EM131875143

Assignment: Combinations and permutations Discrete Structures

Build the following programs:

1. unsigned combABC(unsigned n);

combABC outputs each combination of n letters, where each letter is A, B, or C, exactly once. For

example, combABC(4) would output 15 lines:

combABC should also return the number of combinations; it should be the number of combinations by computation, not just counting how many lines of output it produces.

AAAA
AAAB // or it could just as well output ABAA, since that's the same combination
AAAC
AABB
AABC
AACC
ABBB
ABBC
ABCC
ACCC
BBBB
BBBC
BBCC
BCCC
CCCC

2. unsigned f(unsigned a, unsigned b, unsigned c);

Compute and return the number of strings of a A's, b B's, and c C's. For example, f(1, 2, 1) returns 12 because there are 12 strings made up of 1 A, 2 B's, and 1 C:

ABBC
ABCB
ACBB
BABC
BACB
BBAC
BBCA
BCAB
BCBA
CABB
CBAB
CBBA.

Reference no: EM131875143

Questions Cloud

Writing a c program to find ten most frequently used words : Writing a C program to find ten most frequently used words in a given file. The executable fileshould take as argument the name of a file and outputs ten lines.
Write the content of the array to a second file : Use a second loop to sum the values stored in the array after the prices of all the books have been read. Write the content of the array to a second file.
Evaluate the results of your current investment : Provide your opinion / assessment of your investments. Evaluate the results of your current investment.
Why the new approach is better than the other six kernels : How the result of each one is different from the other. Why the new approach is better than the other 6 Kernels.
Compute and return the number of strings of a as and b bs : Compute and return number of strings of a A's, b B's, and c C's. For example, f(1, 2, 1) returns 12 because there are 12 strings made up of 1 A, 2 B's and 1 C.
Identify the most attractive features of the position : Describe two (2) financial career options that an individual with a finance education might pursue and explain the value that such a position adds to a company.
Is the current policy portfolio efficient : Does the addition of mortgages and commodities as potential investments offer meaningful diversification benefits? Why or why not?
What are the topic under the public expenditure : Can you give me some explanation under the topic of Public Expenditure:Social Insurance and Income Maintenance ?
What is the interface for premium member : Which element in the above diagram is an example of polymorphism? What is the interface for Premium Member?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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