Reference no: EM131414975
Question 1. Write a program to implement the Boyer-Moore algorithm. Your program should ask the user to enter a text and a pattern, then output the following: (a) bad-symbol table (b) good suffix table (c) the searching result (whether the pattern is in the text or not)
Please make sure that the good suffix table is generated correctly. Use the following examples to test your program before submitting your assignment.
Examples:
Good suffix table for the pattern BAOBAB
k = 1 d2 = 2; k = 2, d2 = 5; k = 3 d2 = 5; k = 4 d2 = 5; k = 5 d2 = 5
Good suffix table for the pattern AACCAC
k = 1 d2 = 2; k = 2, d2 = 3; k = 3 d2 = 6; k = 4 d2 = 6; k = 5 d2 = 6
Good suffix table for the pattern AACCAA
k = 1 d2 = 1; k = 2, d2 = 4; k = 3 d2 = 4; k = 4 d2 = 4; k = 5 d2 = 4
Good suffix table for the pattern 10000
k = 1 d2 = 3; k = 2, d2 = 2; k = 3 d2 = 1; k = 4 d2 = 5
Good suffix table for the pattern 01010
k = 1 d2 = 4; k = 2, d2 = 4; k = 3 d2 = 2; k = 4 d2 = 2
Question 2. 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 nonconflicting (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.
Explain the general trend within two subsets of the area
: Choose, at least, three areas and explain the general trend and trends within two subsets of the area (i.e., security has subsets of physical, perimeter, monitoring) over the last three years.
|
Search for competitive advantage
: Why innovation and product development are crucial components of the search for competitive advantage?
|
Important areas of the healthcare revenue cycle
: List and briefly describe the most important areas of the healthcare revenue cycle.
|
Programmed and non-programmed decisions
: What is the difference between programmed and non-programmed decisions?
|
Implement the boyer-moore algorithm
: Write a program to implement the Boyer-Moore algorithm. Your program should ask the user to enter a text and a pattern, then output - Design a greedy algorithm to solve the activity selection problem. Suppose there are a set of activities: a1, a2, ..
|
Complete poster on topic fossil fuels and sustainability
: I have poster under the topic of Fossil fuels and sustainability. I have a complete poster from several years back but I want you guys to do the PROPER changes
|
Link the actions of its subunits into a consistent pattern
: __________ is the set of mechanisms used in an organization to link the actions of its subunits into a consistent pattern.
|
Creating an idea through spontaneous creativity
: Which step in the innovation process focuses on creating an idea through spontaneous creativity, ingenuity, and information processing?
|
Ice cream is obviously seasonal product
: What does "Ice cream is obviously a seasonal product" tell you about how service levels will change throughout the year? Think about shelf space and the implications for safety stock.
|