Apply following to header and footer sections of page:
center text
background color rgb(254,198,179)
padding should be 20px
In: Computer Science
Describe/define/explain
a. The relationship between Java's Iterable and Iterator
interfaces
b. An inner class
c. An anonymous inner class
d. The functionality of an Iterator remove method
In: Computer Science
Assignment details
In: Computer Science
True False
|
The enqueue and dequeue operations in a priority queue take O(lg n) time, while linked list and array implementations take O(1) time. |
||
|
A binary heap is a (nearly) complete binary tree. |
||
|
Heaps usually use a linked node structure for implementation. |
||
|
When implementing heaps as arrays, you can leave a blank space at the front. If you do, the parent of a node at index i can be found at index floor(i/2). |
||
|
When implementing heaps as arrays, if you don't leave a space at the front, you can find the children of the node at index i at 2i and 2i+1. |
||
|
The heap order property states that each node must contain a value greater than its left child and less than its right child. |
||
|
Insertion in a heap is done by adding at the end of the array and "percolating up". |
||
|
The average case for insertion in a heap is O(lg n). The worst case is O(n). |
||
|
Deletion in a heap requires removing the root item and shifting all other items over one space. |
||
|
Building a heap by adding values one at a time is an O(n) operation. Building a heap "all at once" with the heapify() method (called buildHeap() in the textbook) is O(n lg n). |
In: Computer Science
I need to implement a code in python to guess a random number. The number must be an integer between 1 and 50 inclusive, using the module random function randint. The user will have four options to guess the number. For each one of the failed attempts, the program it should let the user know whether is with a lower or higher number and how many tries they have left. If the user guess the number, the program must congratulate the user and tell him how much he won. If you are a user, hit on the 1st attempt He wins first $ 100, on the second $ 75, on the third $ 50, on the fourth $ 25. If the user misses all four opportunities, the program must inform the user that he owes money $ 60 and what was the number that the computer generates randomly.
In: Computer Science
Explain the diagram of Computer System which includes (Hardware, OS, application program and users).
In: Computer Science
The five major activities of an operating system in regard to process management are?
In: Computer Science
In: Computer Science
def main():
phrase = input('Enter a phrase: ') # take a phrase from user
acronym = '' # initialize empty acronym
for word in phrase.split(): # for each word in phrase
acronym += word[0].upper() # add uppercase version of first letter
to acronym
print('Acronym for ' + phrase + ' is ' + acronym) # print
results
main()
The program should then open the input file, treat whatever is on each line as a phrase and make its acronym using the function you wrote. It should print the acronyms, one per line to the output file. Assume that the input file will be already present in your default Python folder. The output file will be expected to get saved to the same folder. See below for an example input file input.txt and its corresponding output file output.txt that the program should generate.
Input: personal computer
Output:PC
In: Computer Science
Write a Java program to do the following USING ARRAYS
1) input 15 integers (input validation, all numbers must be between 0 and 100)
2) find the largest number.
3) Find the Smallest Number
4) Find the Sum of all numbers in the Array
Display:
Largest Number
Smallest Number
Sum of all numbers
the original Array
DO NOT USE METHODS OR FUNCTIONS
In: Computer Science
USE C++ for the program and kindly keep it as simple as possible , use recursion and do not use loops please keep program simple and comment if possible
Suppose you have been given the task to design a text editor
which will take any
multiline text from user and then display the statistics like total
number of characters i.e.,
characters_count (excluding the white space and punctuations),
words_count, and
redundant_words_count. Create a structure named Text_Editor
having four type members
namely inserted_text (of type string), characters_count (of type
unsigned int),
words_count (of type unsigned int), and redundant_words_count (of
type unsigned int).
The structure should also have member functions namely Insert_Text(
) for obtaining the
multiline text from user and assigning to input_text
member-variable. End of text insertion
should be specified by ‘#’ character. Moreover, there should be a
separate member-function
of the created structure named Count_Ch( ), Count_Words( ),
and
Count_Redundant_Words( ) that should process the input text in
order to calculate and
print the relevant statistics. All these different tasks are to be
implemented using recursion
technique.
In: Computer Science
Lab 1 – Numbers in Descending Order
Design an application that accepts 10 numbers and displays them in descending order
For the programming problem, create the pseudocode and enter it below.
Enter pseudocode here
In: Computer Science
Please no plagiarism and must be in your own words. (4 pages minimum)
Case: You run cybersecurity operations for the for a healthcare emergency response logistics firm with global contracts with contracts with the United States and the Canadian government. COVID-19 had caused your organization to move to telework.
Write an overview of 3-4 pages introduction paper explaining what is currently happening. the paper should address the following questions:
In: Computer Science
Describe the fundamental differences between “White Hat, Black Hat, and Grey Hat” Hackers. What do all these different types of hackers have in common? What positive and negative consequences could their actions have? Include a question that responding students can reply to within your initial post.
In: Computer Science