Purchase Solution

Algorithm: Divide a group of people into two disjoint subgroups.

Not what you're looking for?

Ask Custom Question

For example, find a simple algorithm for solving the following problem and classify it using big-theta notation:

Divide a group of people into two disjoint subgroups (of arbitrary size) such that the difference in the total ages of the members of the two subgroups is as large as possible.Now change the problem so that the desired difference is as small as possible and classify your approach to the problem.

Purchase this Solution

Solution Summary

A simple algorithm is found for solving the problem and the approach is discussed. The algorithm is classified using big-theta notation. This solution is approximately 150 words.

Solution Preview

Here is an approach.

Use an efficient sorting algorithm to sort the group of people on the base of their ages for instance in ascending order. Qsort algorithm requires Θ(n log n) comparisons.

a) Put the first person on the sorted order in one ...

Purchase this Solution


Free BrainMass Quizzes
Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic Networking Questions

This quiz consists of some basic networking questions.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.