Answer the following questions(5pt)
a) Write an algorithm that finds the largest item in an
array of n items by using divide-and-conquer algorithm design
pattern.
b) Analyze the worst-case time complexity of your
algorithm in (a), and show the results using asymptotic notation
(ϴ)
In: Computer Science
The following is the pseudocode of algorithm that searches a sorted array of n items by dividing it into three sub arrays of almost n/3 items (7pt). Hint: refer Mergesort algorithm)
Input: Sorted array of Keys(A) indexed from 1 to n.
Output: Location, the Location of K in array A (hint: return 0 if K
is no in A)
index location3 (int A[1…n ], index L, index H)
{
index m1, m2;
if (L > H) return 0;
else
{
m1 = L + (H – L)/3; //one third
m2 = L + 2*(H – L)/3; //two thirds
}
}
a) Complete the pseudocode of the above algorithm which
is indicated by blank box
b) Analyze the worst-case time complexity of your
algorithm in(a), and show the results using the asymptotic notation
(ϴ)
In: Computer Science
Coding – You don’t have to submit the full html document only submit what should be in the <body> element. Be sure to name your form controls, classes and/or ids in a meaningful manor.
5. Create a form that submits to ‘myScript.php’ with a drop down (or select) list that has 3 of your favorite bands, TV shows, movies, or books for the user to select from.
6. Create a form that uses three of the new HTML5 from control types and/or attributes.
Write an essay that talks about some of the best
coding practices we have discussed in class (was last lecture) OR
Create a form that submits to ‘processComment.cfm’ with 4 HTML5
form controls (either type or using HTML5 attributes), and provides
the user with a text area to submit comments to your
webpage.
In: Computer Science
Coding – You don’t have to submit the full html document only submit what should be in the <body> element. Be sure to name your form controls, classes and/or ids in a meaningful manor.
1. Create the HTML needed to have the largest heading with your name followed by an ordered list with your top favorite 5 bands, TV shows, movies or books.
2. Create a document that contains 3 hyperlinks. One hyperlink should contain an absolute path, another should contain a relative path, and the last hyperlink should contain your e-mail address.
3. Create a table (border is optional) that contains a caption, headers and data about your 3 favorite bands, TV shows, movies or books. The table must contain at least 2 columns.
4. Create a form that submits to ‘myscript.cfm’ that
includes input from the user. The input should be the user’s
firstname, lastname, and email address. Be sure to include a submit
button.
In: Computer Science
Short Answer – Please answer these questions with a sentence or two.
5. What does an e-mail link do?
6.What are the four basic principles of Web Design?
7. What is the purpose of <thead>, <tbody>, <tfoot> elements
8. What is the difference between an element and an
attribute?
In: Computer Science
After completing this module's learning activities, what are your thoughts about the systems security function in an organization? What short and long term goals are most important? (Support your analysis with evidence from the module.) How has this module changed your perspective on security in technology? Sometimes it seems like an endless race between hackers and security experts... who is ahead? Will we ever gain a significant lead? How?
In: Computer Science
// This pseudocode is intended to determine whether students have
// passed or failed a course; student needs to average 60 or
// more on two tests.
start
Declarations
num firstTest
num secondTest
num average
num PASSING = 60
output "Enter first score or 0 to quit "
input firstTest
while firstTest not equal to 0
output "Enter second score or 0 to quit"
input secondTest
average = (firstTest + secondTest) / 2
output "Average is ", average misspelled “t” for the word output
if average >= PASSING then
output "Pass"
else
output "Fail"
endif
endwhile
stop
In: Computer Science
Please use jGRASP program to solve the following project.
This program assesses your ability to use functions, arrays, for loops, and if statements where needed.
You are writing a program to track bird sightings in Prince William County for a weekend event where bird watchers watch birds and record each unique species that they see. Over a weekend, Saturday and Sunday, the bird watchers (aka birders) are going to record how many bird species they sight each day. You begin by asking the user how many bird watchers are participating in the event. Validate the response with a while loop to ensure that the value entered is between 0 and 100. Once you have a valid response, a for loop is entered for processing 4 parallel arrays. The size of each of the parallel arrays is equal to the number of bird watchers entered by the user.
The first array will store the name of the Bird Watcher.
The second array will store how many sightings (quantity) of different birds that the bird watcher reports for Saturday. Use a while loop to validate the quantity to make sure that it falls in the range of 0 to 250 inclusive. (Supposedly the world record for sighting different species of birds in one day by one person is 200; therefore, 250 should be reasonable for the maximum quantity of birds sighted by one person in a single day.)
The third array will store how many sightings (quantity) of different birds that the bird watcher reports for Sunday. Use a while loop to validate the quantity to make sure that it falls in the range of 0 to 250 inclusive.
The fourth array will store the total sightings for both days that adds the sightings for Saturday + the sightings for Sunday reported by the bird watcher.
If you have at least 1 bird watcher, print the contents of the parallel arrays meaning the bird watcher’s name, Saturday sightings, and Sunday sightings, and Total Sightings for each bird watcher. You also need to calculate the average sightings from the Total Sightings array by using a calcAverage() function. You also need to search for the Bird Watcher with the most sightings and print their name out with the number of sightings for that person.
If you do not have any bird watchers (meaning if the user entered 0 bird watchers when prompted at the beginning of the program), end the program with a goodbye message.
The following functions are required although:
The next page shows the output from the program running with some test data. Remember that your program must run for any number of bird watchers and not just these 3 bird watchers and data shown below.
Welcome to the Prince William County Bird Watching weekend tracking system.
___________________________________________________________
Please enter the number of bird watchers:
3
-------------------------Bird Watcher 1 -------------------------
Please enter the bird watcher’s Name:
Ima Watcher
Please enter the birds sighted on Saturday:
25
Please enter the birds sighted on Sunday:
30
-------------------------Bird Watcher 2 -------------------------
Please enter the bird watcher’s name:
Ann Lookin
Please enter the birds sighted on Saturday:
30
Please enter the birds sighted on Sunday:
35
-------------------------Bird Watcher 3 -------------------------
Please enter the bird watcher’s name:
Guy Oakley
Please enter the birds sighted on Saturday:
35
Please enter the birds sighted on Sunday:
40
------------------------------------------------PWC Birdwatching Statistics-----------------------------------------
Bird Watcher Saturday Sightings Sunday Sightings Total Sightings
Ima Watcher 25 30 55
Ann Lookin 30 35 65
Guy Oakley 35 40 37.5
Average Sightings 52.5
The Bird Watcher with the most sightings of 75 is Guy Oakley.
----------------------------------------------Thanks For Using Our Program---------------------------------
In: Computer Science
What are the benefits of using cloud computing in a university?
In: Computer Science
I have below code! I would like to to convert the larger variable to hex and get len() of larger once it's in hex format.
Example: if larger number is 900000 then the hex is DBBA0 then len of DBBA0 is 5. I need everything save in new variable!
It's in C.
// Function to find largest element
int largest(int a[], int n)
{
int large = a[0], i;
for(i = 1; i < n; i++)
{
if(large < a[i])
large = a[i];
}
return large;
}
In: Computer Science
Plot the function y = 10 *(1 -exp(x/4)) over the interval 0 <x < xmax , using a for loop to determine the value of xmax such that y(xmax)=9.8. Properly label the plot. variable y is represents force in Newtons , and x represents time in second.
In: Computer Science
java cryptography extension with an example from end to end with code explanation. it should support Java 8 and AES 256.
how to do encrypt and decrypt the specific example.
Enable AES 256-bit encryption for Java 8 with a sample developed code and workflow. Thank you so much.
In: Computer Science
Represent the above sentences into FOL(first Order Logic)
formulas with defining your ontology.
-> Every man does not hit a woman whom he marries. Jason and
Kale are men and Mary is a woman. Mary marries either Jason or
Kale. Kale hit Mary. Does Mary marries Jason?
In: Computer Science
Write a program FileCounter.java that reads a text file text1.txt and reports the number of characters and lines contained in the file. For example, the output should be as follows:
Lines: 5 Chars: 124
Note: Write a main() method to test in the FileCounter.java. The file path should use relative path. Must use the provided text file text1.txt.
The text file say
This is an example 1
This is an example 1 2.
This is an example 1 2 3.
This is an example 1 2 3 4.
This is an example 1 2 3 4 5.
2. Suppose you have a binary file geo.dat (see provided data file) of data for a geological survey, such that each record consists of a longitude, a latitude, and an amount of rainfall, all represented by double. Write a program GeologicalData.java to read this file’s data and print them on the screen, one record per line.
Note: Write a main() method to test the code in the GeologicalData.java. The file path should use relative path and the actually file path should be passed into the method getData(String fileName) in the main() method. Must use the provided file geo.dat which has already contained the following data.
-143.78914479979002 59.482245058443084 17.645846630300042 -117.80303714838257 -25.94559103704657 4.513879725440151 49.63942128783603 129.1664680590585 6.825838082783708 -79.66606860669573 -18.800024954102696 9.501515919083086 62.82522223390336 -60.409595996464006 2.6984128008196984
The partial Coding is
public class FileCounter {
}
The other Coding
public class GeologicalData {
public static void getData(String fileName){
}
}
In: Computer Science
PLEASE COMPLETE BOTH PARTS (LANGUAGE: C++ if necessary)
Part I
For the following example, determine the number of comparisons that will take place during a search using both searching algorithms (Linear search and binary search). Also, list each comparison for each algorithm(Linear and binary). The number being searched for is 13.
List = {1,3,5,9,10,11,15,17,19,23,24,25,29,31,33,37,38,39,43,45,47,51,52,53,57,59,61}
Part 2
For the following example, determine the number of swaps that will take place during a sort using both sorting algorithms (bubble and selection sort). Also, list each swap for each algorithm (bubble and selection)
List = {23, 10, 3, -5, 2, 7, 0, 20, 15, 17, 9, 11, 4, 1}
In: Computer Science