Questions
Write a java program which can randomly generate a permutation of the integer {1, 2, 3,...

Write a java program which can randomly generate a permutation of the integer {1, 2, 3, ..., 48,49,50}. Use the most efficient sorting algorithm to sort the list in an acceding order.

In: Computer Science

Python Coding Question: Find the minimum number of coins that make a given value.

Python Coding Question: Find the minimum number of coins that make a given value.

In: Computer Science

linux use the command dmesg, use grep to filter and then redirect just the lines with...

linux

use the command dmesg, use grep to filter and then redirect just the lines with the word Linux in them from the output generated by the dmesg command. redirect this output to a file at the path PutFileHere/Dmesgoutput.txt. What command did you use to do this, if there is no output choose a different word to grep for in the output of this command and substitute that word.

In: Computer Science

This LinkedListUtil class tests various usages of the LinkedList class. The single param is an array...

This LinkedListUtil class tests various usages of the LinkedList class. The single param is 
an array of string. You will create a linked list with the string elements and return the 
linked list with all but the 1st two elements removed.

Note: In this question use a for or while loop instead of the suggested iterator. You should also ignore CodeCheck’s error message about a missing class (LinkedListUtil.class). Your code still needs to pass all test cases.

EDIT: you want to remove all besides the first 2 elements. So only the first 2 elements should be returned

LinkedListUtil.java

import java.util.LinkedList;
import java.util.ListIterator;

/**
This LinkedListUtil class tests various usages of the LinkedList class
*/
public class LinkedListUtil
{
/**
Constructs a LinkedListUtil.
@param list is the initialized list
*/
public LinkedListUtil(LinkedList list)
{
this.list = list;
}

/**
deletes all but the first two linked list enries
*/
public void processList()
{
// TODO: create a list iterator and remove all but the first two elements
}


private LinkedList list;

// this method is used to check your work
public static LinkedList check(String[] values)
   {  
LinkedList list = new LinkedList();
for (String s : values)
       list.addLast(s);

LinkedListUtil tester = new LinkedListUtil(list);
tester.processList();
return list;
}

}

In: Computer Science

Question #1 Data Modelling is the primary step in the process of database design. Compare and...

Question #1

Data Modelling is the primary step in the process of database design. Compare and contrast Conceptual data model versus Physical data model. Illustrates with help of example to list down data (entities), relationship among data and constraints on data.

Question #2

What strategic competitive benefits do you see in a company’s use of extranets?

Question #3

Explain how Internet technologies are involved in developing a process in one of the functions of the business? Give an example and evaluate its business value.

Question #4

What are the basic differences between HRM, Intranet and Internet in terms of Domain and Network Communication Scope?

All information are written. there is no more information.

In: Computer Science

Objective Make a function to serve as a Craps dice game simulator. If you are not...

Objective

Make a function to serve as a Craps dice game simulator. If you are not familiar Craps is a game that involves rolling two six-sided dice and adding up the total. We are not implementing the full rules of the game, just a function that returns the value of BOTH dice and their total.

Details

In the function you create: Make a function that uses pointers and pass by reference to return THREE separate outputs (arrays are not allowed). Inside the function you will call rand() to represent a random dice roll of a six sided dice. One output will be the first call to rand() and represent the first dice roll. The second output will be a second call to rand() and represents the second dice roll. The third output is the total of the two other outputs added together.

You may choose either options for defining the function:

Option A:

  • RETURN: void function
  • PARAMETERS: Three variables that use pass by reference. Two of them are set to the dice rolls within the function. The third is the total of the two dice rolls added together.

Option B:

  • RETURN: int value - Total of the two dice rolls.
  • PARAMETERS: Two variables that use pass by reference, each one is set to a random dice roll.

In the Main Function: Call srand() to initialize the pseudo-random algorithm. Create three variables to hold your outputs, the two dice rolls and the total. In a for loop call your dice roll function FIVE times, each time it should set the three variables to new values. Also within the for loop print the values of the dice rolls and the total.

  • No input is required from the user this time. Everything that is output is done from the random function.
  • Add #include <time.h> to your code.
  • In the main function the call to srand looks like:
    • srand(time(NULL));
  • In the dice roll function the call to represent a six sided dice looks like:
    • rand() % 6 + 1
  • Do not just call printf from within the dice roll function! Demonstrate that you can receive multiple outputs from the same function

In: Computer Science

C Programming How do you read in a text file line by line into a an...

C Programming

How do you read in a text file line by line into a an array.

example, i have the text file containing:

line 1: "qwertyuiop"

line 2: "asdfghjkl"

line 3: "zxcvbnm"

Then in the resulting array i get this:

array:"qwertyuiopasdfghjklzxcvbnm"

In: Computer Science

How does Linux share printers differently than Windows?

How does Linux share printers differently than Windows?

In: Computer Science

Can the following code be modified to use a mutex lock rather than a semaphore? Why...

Can the following code be modified to use a mutex lock rather than a semaphore? Why or why not? (sem_post() is the POSIX form of signal())

sem_t sem;

sem_init(&sem, 0, 1);

sem_wait(&sem);

// critical section

sem_post(&sem);

sem_destroy(&sem);

In: Computer Science

Consider this code: "int v = 20; --v; System.out.println(v++);". What value is printed, what value is...

Consider this code: "int v = 20; --v; System.out.println(v++);". What value is printed, what value is v left with?

20 is printed, v ends up with 19
19 is printed, v ends up with 20
20 is printed, v ends up with 20
19 is printed, v ends up with 19
cannot determine what is printed, v ends up with 20

In: Computer Science

Hi, These question is about flooding attack. I need more detail about it. Provide at least...

Hi, These question is about flooding attack. I need more detail about it.

  1. Provide at least two technology alternatives for addressing the security topic chosen by the team. For each potential technology considered, provide an overview of its operation, availability, cost, implementation issues, and overall benefit to the end-user.
  2. Perform an analysis of the candidate technologies. This analysis should include both qualitative and quantitative techniques. Based upon your analysis, select a suitable solution and justify your selection.

In: Computer Science

Write program that pass unsorted one dimensional array and a key to function, the function will...

Write program that pass unsorted one dimensional array and a key to function,
the function will search for the key(using linear search) and if it is found the
function will sort the array from the beginning to the position of the key, and f
it is not found the function will sort all the array
Note: please solve it by c , not c++

In: Computer Science

A good strategy to manage the memory consumed by an array-based implementation of ListInterface is Group...

A good strategy to manage the memory consumed by an array-based implementation of ListInterface is

Group of answer choices

to quadruple the size of the array when it is full and to cut it to one quarter when it is one quarter full

to double the size of the array when it is full and to cut it to half when it is half full

to triple the size of the array when it is full and to cut it to half when it is half full

to double the size of the array when it is full and to cut it to 3/4 when it is one half full

All of the above

When removeGap(pos) method of an array-based implementation of ListInterface is called, no entries will be moved if pos is equal to

Group of answer choices

numberOfEntries

numberOfEntries – 1

1

0

None of the above

Our AList (array-based) implementation of the List interface has an initial capacity of 25 elements. We add 101 items using the method add(). We then remove 50 items using the method remove(). Assuming that remove() doesn't change the size of the array, what is the length of the array after the last call to remove()?

Note that length of array can be different from the number of entries in the array.

Group of answer choices

50

51

75

100

200

In an array-based implementation of ListInterface, what is the time complexity of removing an entry from the end of the list when remove() doesn't change the length of the array?

Group of answer choices

O(1)

O(log n)

O(n)

O(n2)

none of the above

In: Computer Science

There are two text files, whose names are given by two String variables, file1 and file2....

There are two text files, whose names are given by two String variables, file1 and file2. These text files have the same number of lines. Write a sequence of statements that creates a new file whose name consists concatenating the names of the two text files (with a "-" in the middle) and whose contents of merging the lines of the two files. Thus, in the new file, the first line is the first line from the first file, the second line is the first line from the second file. The third line in the new file is the second line in the first file and the fourth line is the second line from the second file, and so on. When finished, make sure that the data written to the new file has been flushed from its buffer and that any system resources used during the course of running your code have been released.(Do not concern yourself with any possible exceptions here-- assume they are handled elsewhere.)

In: Computer Science

Write program to store ten integers in an array and the program will do the following...

Write program to store ten integers in an array and the program will do the
following
Find the average of even marks

Find how many prime integers inserted
Note: please solve it by c , not c++

In: Computer Science