Questions
What are the two modes of encryption that allow random access to the ciphertext blocks. Specifically,...

What are the two modes of encryption that allow random access to the ciphertext blocks. Specifically, if a hacker has the information about i-th cyphertext block Ci and it can find the plaintext Pi without having any other cyphertext blocks.

In: Computer Science

Create a MIPS program that will "hard code an integer" (meaning declared in .data) and read...

Create a MIPS program that will "hard code an integer" (meaning declared in .data) and read in another integer, multiply them together, and print out the results.

In: Computer Science

Briefly argue why it is untrue to say that public-key encryption is more secure than conventional...

Briefly argue why it is untrue to say that public-key encryption is more secure than conventional encryption.

In: Computer Science

C++ please 6.32 LAB: Exact change - functions Write a program with total change amount as...

C++ please

6.32 LAB: Exact change - functions

Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies.

Ex: If the input is:

0 

or less, the output is:

no change

Ex: If the input is:

45

the output is:

1 quarter
2 dimes 

Your program must define and call the following function. Positions 0-4 of coinVals should contain the number of dollars, quarters, dimes, nickels, and pennies, respectively.
void ExactChange(int userTotal, vector<int>& coinVals)

In: Computer Science

A subject is a resource to which access is controlled. True False

A subject is a resource to which access is controlled.

True

False

In: Computer Science

Discuss three challenges faced when auditing a cloud environment. (200-300 words)

Discuss three challenges faced when auditing a cloud environment. (200-300 words)

In: Computer Science

Can you solve and send me the original code which I can copy and paste plz....

Can you solve and send me the original code which I can copy and paste plz. Thank you.

Kahn's Algorithm

Implement Kahn's Algorithm for giving a topological ordering of a graph as discussed in class. The input graph will be in adjacency list format.

1. Count the in-degree (number of edges ending at) each vertex.

2. Create a queue of nodes with in-degree 0.

3. While the queue is not empty:

a. Add the first element in the queue to the ordering.

b. Decrement the in-degree of each of the first element’s neighbors.

c. Add any neighbors that now have in-degree 0 to the queue.

d. Remove the first element from the queue.

4. If the ordering doesn't contain all nodes then the graph had a cycle and we return None

5. Else we return the ordering

 

graph = [

[1, 3],

[],

[3, 6, 7],

[6],

[],

[],

[],

[5, 4],

]

order = topological(graph)

print(order)

[0, 2, 1, 3, 7, 6, 4, 5] # one POSSIBLE ordering

order.index(0) < order.index(3)

order.index(0) < order.index(1)

order.index(2) < order.index(3)

order.index(2) < order.index(6)

order.index(2) < order.index(5)

order.index(3) < order.index(6)

order.index(7) < order.index(5)

from collections import deque

#complete following code

def topological(graph):
in_deg = [0 for _ in range(len(graph))]
  
for node1 in range(len(graph)):
for node2 in graph[node1]:
in_deg[node2] += 1
  
queue = deque()
"""
Iterate over all the nodes and append the nodes with in-degree 0 to the queue
"""
# your code here
  
ordereing = []
while len(queue) > 0:
current_node = queue.popleft()
ordereing.append(current_node)

for neighbor in graph[current_node]:
in_deg[neighbor] -= 1
"""
If this neighbor in-degree now becomes 0, we need to append it to the queue
"""

# your code here
  
"""
If we couldn't process all nodes, this means there was a cycle in the graph
and the graph wasn't a DAG.
"""
if len(ordereing) != len(graph):
return None
  
return ordereing

order.index(7) < order.index(4)

In: Computer Science

Write the following Python script: Imagine you live in a world without modules in Python! No...

Write the following Python script:

Imagine you live in a world without modules in Python! No numpy! No scipy! Write a Python script that defines a function called mat_mult() that takes two lists of lists as parameters and, when possible, returns a list of lists representing the matrix product of the two inputs. Your function should make sure the lists are of the appropriate size first - if not, your program should print “Invalid sizes” and return None. Note: it is actually tricky to make a useful list of zeros. For instance, if you need to start with a 5 row, 6 column double list of 0, you might be tempted to try:

'''

thing = [ [ 0 ] ∗ 6 ] ∗ 5

'''

and if you look at it in the console window, it would appear to be a 5 by 6 list of lists containing all zeros! However - try the following and see what happens:

'''

thing [ 2 ] [ 5 ]

thing

'''

Notice that the item in index 5 of every row has changed, not just the row with index 2! Given the difficulty, I will give you the line of code that will create a list of lists that is num_rows by num_cols:

'''

ans = [ [ 0 for col in range ( num_cols ) ] for row in range ( num_rows ) ]

'''

In: Computer Science

(JAVA): The Collection ADT 1. We have a Circle class that includes radius attribute of type...

(JAVA): The Collection ADT

1. We have a Circle class that includes radius attribute of type int, set by the constructor. Write a compareTo method for this class so that circle objects are ordered on the basis of their circumference (? = 2??).

2. We have a Person class that includes name and age attributes of type String and int respectively, both set by the constructor. Write a compareTo method for this class so that person objects are ordered on the basis of their name.

In: Computer Science

How many cost units are spent in the entire process of performing 40 consecutive append operations...

How many cost units are spent in the entire process of performing 40 consecutive append operations on an empty array which starts out at capacity 4, assuming that the array will double in capacity each time a new item is added to an already full dynamic array? As N (i.e., the number of appends) grows large, under this strategy for resizing, what is the average big-O complexity for an append?

How many cost units are spent in the entire process of performing 40 consecutive append operations on an empty array which starts out at capacity 4, assuming that the array will grow by a constant 2 spaces each time a new item is added to an already full dynamic array? As N (i.e., the number of appends) grows large, under this strategy for resizing, what is the average complexity for an append?

In: Computer Science

In this scenario, we have a poorly performing PC, and we suspect it might be a...

In this scenario, we have a poorly performing PC, and we suspect it might be a process that is causing issues. In our process of troubleshooting, we want to:

1, to view a list of all running processes to examine which ones are using the most RAM (Memory).

2, to view the list of all non-running processes (e.g. the status is suspended, not responding, or unknown).

3, to view all running processes under the user account, System. Not processes with the word, System, in the process name.

4, to stop all processes begin with the letter S.

In: Computer Science

Part 2- - Create and display a singly Linked List with 5 elements (see below)                 Node*...

Part 2- - Create and display a singly Linked List with 5 elements (see below)

                Node* head

                 Node*second

                 Node*third

                Node*forth

                 Node*fifth

2-Assign the data 5, 6, 8, 10, 12 to each node 3-Display the output

GIVEN CODE:

#include <studio.h>

struct Array { int A[10]; int size; int length; };

void Display(struct Array arr)

{

     int i; printf("\nElements are\n");

     for(i=0;ilengthsize) arr->A[arr->length++]=x;

}

void Insert(struct Array *arr,int index,int x)

{

     int i;

         if(index>=0 && index <=arr->length)

{

     for(i=arr->length;i>index;i--)

     arr->A[i]=arr->A[i-1]; arr->A[index]=x; arr->length++;

}

}

int main()

{

struct Array arr1={{2,3,4,5,6},10,5};

Append(&arr1,10);

Insert(&arr1,0,12);

Display(arr1);

return 0;

}

In: Computer Science

Write a method named minimumValue, which returns the smallest value in an array that is passed...

Write a method named minimumValue, which returns the smallest value in an array that is passed (in) as an argument. The method must use Recursion to find the smallest value. Demonstrate the method in a full program, which does not have to be too long regarding the entire code (i.e. program). Write (paste) the Java code in this word file (.docx) that is provided. (You can use additional pages if needed, and make sure your name is on every page in this word doc.) Use the following array to test the method: int[] series array = {-5, -10, +1999, +99, +100, +3, 0, +9, +300, -200, +1, -300} Make sure that the series array only tests for values, which are positive, given your recursive method.

Part II (25 points) Algorithmic Performance as you are aware, consists (mainly) of 2 dimensions: Time and Space. From a technical perspective, discuss the following:  Regarding runtime, discuss algorithmic performance with respect to its runtime performance. As you develop an algorithm, what must you also consider in terms of some of the trade-offs? How would you go about estimating the time required for an algorithm’s efficiency (i.e. time to complete in terms of its potential complexity)? What techniques can you use? Give an example of how to measure it.

In: Computer Science

What are the data structures. How these are useful in different fields of computer science. Discuss...

What are the data structures. How these are useful in different fields of computer science. Discuss at least three fields.

In: Computer Science

Create Lab project Add the following codes to your main method. Compile and run the program...

  1. Create Lab project
  2. Add the following codes to your main method. Compile and run the program with some arguments and observe the output.

      printf("You have entered %d arguments.\n", argc);

      for (int i = 0; i < argc; ++i)

        printf( "argument %d: %s\n",i+1,argv[i]);

  1. Create a function called simpleFileWrite() and add the following feature: Open a write only file called “myfile.txt” and write characters into it. The set of characters are read form the keyboard until cntrl-z is entered. (use putc() and getc() function; in your c code use EOF to compare with cntrl-z).
  2. Compile, build and run the program. Now print the file contents on the console using the linux command “cat myfile.txt” and observe the contents.
  3. Create a function called simpleFileRead() and add the following feature: Open the file “myfile.txt” as a read only file from within your program and read characters from it and print it on the console using the printf command.
    1. Also count the number of characters in the file
    2. Observe the output to compare whether it matches with the entries that you made from the keyboard earlier.
  4. Create a function called stringHandler() and add the following feature: Write set of strings each of length 40 into a file “stringc.txt”. Close the file and then reopen to read. Now display the contents of the file (use fputs() and fgets() function).
  5. Create a function called mixedDataHandler() and the add the following feature: Write name, age and height of a person into a data file “person.txt”. Close the file and reopen it to read from it (use fprintf() and fscanf() function).
  6. Create a C file called myCopy.c, which will process command line arguments. The first argument will be the name of the program itself, the second argument will be the source file to copy from, and the 3rd argument will be the destination file to copy to. If the user doesn’t provide argument 2 then show error message that “Source file name needed”. If the user does not provide the 3rd argument then use “default.txt” as the name of the output file.

please help me, this is c programming. thank you in advance.

In: Computer Science