Design greedy algorithm to solve activity selection problem

Assignment Help Data Structure & Algorithms
Reference no: EM13326596

Design a greedy algorithm to solve the activity selection problem. Suppose there are a set of activities: a1, a2, ... an that wish to use a lecture hall. Each activity ai has a start time siand a finish time fi. A lecture hall can be used by only one activity at a time. Two activities can be scheduled in the same lecture hall if they are non-conflicting (fi<= sj or fj<= si) Your algorithm should find out the minimum number of lecture halls needed to hold all the activities. Write a program to implement your algorithm. For example: if the activities you need to schedule have the following start times and finish times,


4 7
6 9
7 8
1 3
1 4
2 5
3 7

then the output of your program is "the minimum number of lecture halls required is 3". Also indicate which activity will be scheduled in which lecture hall.

 

Reference no: EM13326596

Questions Cloud

What is her velocity at the bottom of the swing : A gymnast whose mass is 50.0 kg swings back and forth on a 4.0m long rope. What is her velocity at the bottom of the swing
What is the height of the table : What is the gravitational force between two 20-kg iron balls separated by a distance of .9 m? What is the height of the table
Create a work plan : Design a dynamic programming algorithm to find the value of the optimal plan. Implement your algorithm using any programming language you prefer. Describe the recurrence relation used by your algorithm at the top of your program or in a separate f..
Identify the budgetary accounts used in federal agency : Identify the budgetary accounts used in federal agency accounting and explain the sequential flow of budgetary authority through the accounts in your own words.
Design greedy algorithm to solve activity selection problem : Design a greedy algorithm to solve the activity selection problem. Suppose there are a set of activities: a1, a2, ... an that wish to use a lecture hall. Each activity ai has a start time siand a finish time fi.
Evaluate account balances : Shiras Distributing Company had the following account balances - the company completed the following summary transactions.
What is its maximum height above the ground : A gray kangaroo can bound across level ground with each jump carrying it 8.1m from the takeoff point. What is its maximum height above the ground
Implement the boyer-moore algorithm using any program : Implement the Boyer-Moore algorithm using any programming language you prefer.
What is the temperature of the aluminum disk : A thick, vertical iron pipe has an inner diameter of 0.077 m. A thin aluminum (? = 23x10-6 (C°)-1) disk, What is the temperature of the aluminum disk when the disk falls into the pipe

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Program development cycle for algorithm using pseudocode

Illustrate all your work. Use modular approach to solving this problem. Give the following submodule. Calculations - module to compute gross pay. Using the Program Development Cycle, develop an algorithm using pseudocode for the following task.

  Primitives-remove ambiguities in algorithm-s representation

Describe how the use of primitives helps remove ambiguities in an algorithm's representation.

  Sort array of elements using the quick sort algorithm

"sort an array of 10,000 elements using quick sort algorithm as follows: sort the array using pivot as middle element of the array

  Administration plan for the hypothetical situation

Discuss how would you approach a backup and administration plan for hypothetical condition given below. With any network administration systems that should be installed for remote access in event of a network emergency.

  Efficient algorithm to achieve goal using few base stations

Certain points along the road, so that every house is within four miles of one of the base stations. Give an efficient algorithm that achieves this goal using as few base stations as possible.

  Generalize 2-3 algorithms for insert and delete

Generalize the 2-3 algorithms for INSERT and DELETE to K-J trees, where non-leaf vertices have between K and J children for fixed integers K >=2, and J>= 2K-1.

  Calculating an arithmetic mean, median and mode

Calculate an arithmetic mean, median, and mode for up to fifty test scores. The information are contained in a text file. To determine the median, first sort the array.

  Setup an example rsa public/private key pair using primes

RSA with three primes would also work: n = pqr, ?(n) = (p?1)(q?1)(r?1), gcd(e, ?(n)) = 1, and d = e^?1 (mod ?(n)).

  Single binary search tree

You must store the words and the counts of the words in a single binary search tree and each word occurring in the text can only be stored once in the tree

  Create the entity relationship diagram

Create the entity relationship diagram for your project database based on the initial data requirements.

  Identifying the location of rubric objectives

Code Comments are used to identify the location of rubric objectives, Code Formatting is used to raise the readability of the HTML Code.

  Determine computational complexity of algorithm

Describe the algorithm in psuedo-code. You should give thought to what data structures(s) make sense for e client implementation. Determine computational complexity of your algorithm.

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