Questions
Okay so I already completed steps A - C listapi is now a library for project...

Okay so I already completed steps A - C listapi is now a library for project 4 the trouble I am having is how to do part D.

Use ListAPI as a library.

a) Create a Intellij project and name it “p4_2_your-id”.

b) Create a JAR file of “ListAPI”.

Download “ListAPI.zip” from Moodle and extract the NetBeans project folder “ListAPI” from the archive file.

In NetBeans, open “ListAPI”. Under the Project tab, right click on ListAPI and select Clean. Under the Project tab, right click on ListAPI and select Build. The created jar file is in “dist” folder.

Move the JAR file to the folder that contains your project folder. Navigate to the “ListAPI” NetBeans project folder and open it. Open the folder “dist”. Copy the file “ListAPI.jar” and paste it in the same folder that contains the “p5_2_your-id” project folder.

c) Attach the “ListAPI.jar” to your project.

Under the NetBeans Project tab, open the project created in step (a).

Right click on Libraries and select “Add JAR/Folder...”, and then navigate to “ListAPI.jar”. In the Add JAR/Folder dialog box, select “ListAPI.jar”, select Relative Path (which, if you have followed the preceding instructions, will be “../ListAPI.jar”) and click OK.

The classes in the JAR file are now available either by adding the following import statement to classes in your project

import listapi.*;

or by entering the full name of a class as in the following example.

        listapi.TestGenericQueue tgq
        = new listapi.TestGenericQueue();

d) In your project “p4_2_your-id”, add code to enqueue 5 integer values in a listapi.GenericQueue, displaying the queue as each value is added. Then, dequeue each element in the queue, adding each value to a listapi.GenericStack, displaying the queue and stack as each value is moved from the stack to the queue. Finally, pop all values of the stack and add them to a listapi.MyArrayList, displaying the stack and the list as each value is moved from the stack to the list.

In: Computer Science

Write the pseudo code for longest common subsequence algorithm in Java. Alg lCS( X , n,...

Write the pseudo code for longest common subsequence algorithm in Java.

Alg lCS( X , n, Y, m)

Input: String X of length n, String Y of length m

Output: return the length of the longest common subsequence between X and Y

In: Computer Science

1) Suppose we have the following IP addresses for two different organizations, we have to create...

1) Suppose we have the following IP addresses for two different organizations, we have to create 5 networks having 30 hosts in it. Find first sub network ID, Fist address, Last address and Broadcast for each of the following given addresses?

a) 14.23.120.8

b) 252.5.15.111

In: Computer Science

Utilizing PHP and HTML code Create a form that has text inputs for two numbers and...

Utilizing PHP and HTML code

Create a form that has text inputs for two numbers and a submit button. Submit the values to a program that calculates and displays the GCD of the two numbers. The greatest common divisor of two integers a and b is the largest integer that is a factor of both a and b.

The GCD of any number and 1 is 1, and the GCD of any number and 0 is that number.

For example:
gcd(24, 84) =12,
gcd(105, 45) =15,
gcd(409, 1) = 1,
and gcd(0, 8) =8.

You could set up a loop for each number and find all the factors using the modulo operator. Then you could compare the two lists of factors and find the largest number they have in common. This would work but it is going to be slow for very large numbers.

One efficient way to compute the GCD is to use Euclid's Algorithm, which states the following:

gcd(a, b) = gcd(b, a % b)
gcd(a, 0) = Absolute value of a

Here is an example of using this algorithm for 154,320 and 4,320

  1. Find the larger of the two numbers = 154,320
  2. 154320 % 4320 = 3120
  3. 154320 % 3120 = 1440
  4. 154320 % 1440 = 240
  5. 154320 % 240 = 0 **** the remainder is 0 so the GCD is 240

Looks like it would be perfect for a while loop.

In: Computer Science

I need to make pseudo code for hybrid priority queue using both minheap and maxheap by...

I need to make pseudo code for hybrid priority queue using both minheap and maxheap by ARRAY.
i need to have a function that extends the size of array once it meets certain condition.

Also, I need to implement function remove, insert(k,v), top, toggle, switchtoMin, switchtoMax, state, isEmpty, and size.
Please guide me the pseudo code with above conditions

In: Computer Science

This is for c++ Write a program that works with two arrays of the same size...

This is for c++

Write a program that works with two arrays of the same size that are related to each other in some way (or parallel arrays). Your two arrays must be of different data types.

For example, one array can hold values that are used in a formula that produces the contents of the second array. Some examples might be:

 from a previous program, populations and the associated flowrates for those populations (an int array of populations and a double array of the associated flowrate)

 a series of values and the square roots of those integers (an int array of values and a double array of associated square roots)

 a series of values and an indication of whether or not each value is odd or even (an int array and a bool array)

1. Declare and initialize a constant to represent the size of both arrays (at least 10 positions)

2. Declare and initialize your first array

3. Declare and initialize your second array, based on the data in your first array

4. Output the contents of both arrays in neat columns with headers

Optional suggestions (good to do, not required)

1. Try to break your program up into different functions

2. Use user input to initialize the first array

In: Computer Science

Write an MPI program that implements the hypercube bitonic sort algorithm. The program should be tested...

Write an MPI program that implements the hypercube bitonic sort algorithm. The program should be tested using a sequence of 64 integers (from 1 to 64, initially not sorted) and 8 processes. The number of elements assigned to each process is 8.

In: Computer Science

Operating system : Concurrent processes P0 and P1 use the following C-codes to access a critical...

Operating system :
Concurrent processes P0 and P1 use the following C-codes to access a critical section CS:

Void p0() / / process P0

{

while (TURE){

Flag[0]=TURE; turn=1;

While (flag[1]&&(turn==1))

Critical section;

Flag[0]=FALSE;

} }


Void p1() / / process P1

{

while (TURE){

Flag[1]=TURE; turn=0;

While (flag[0]&&(turn==0))

Critical Section (CS);

Flag[1]=FALSE;

} }

where the initial values for the shared variables are:

boolean flag[2] ;

int turn=0;

flag[0]=false; flag[1]=false;


The above implementation of P0 and P1 guarantees ()


A) both mutual exclusion for CS access and bounded-waiting for entry to CS

B) neither mutual exclusion for CS access, nor bounded-waiting (non-starvation) for entry to CS

C) mutual exclusion for CS access, but not bounded-waiting for entry to CS

D) bounded-waiting for entry to CS, but not mutual exclusion for CS access



please provide explanation for your answer.

please only answer id you are sure of the answer thank you.

In: Computer Science

Please write in java: Write a fragment that reads a sequence of strings and inserts each...

Please write in java: Write a fragment that reads a sequence of strings and inserts each string that is not numeric at the front of a deque and each string that is numeric at the rear of a deque. Your fragment should also count the number of strings of each kind. Display the message "Strings that are not numeric" followed by the nonnumeric strings and then the message "Strings that are numbers" followed by the numeric strings. Do not empty the deque.

In: Computer Science

Operating system : Concurrent processes P0 and P1 use the following C-codes to access a critical...

Operating system :
Concurrent processes P0 and P1 use the following C-codes to access a critical section CS:

Void p0() / / process P0

{

while (TURE){

Flag[0]=TURE; turn=1;

While (flag[1]&&(turn==1))

Critical section;

Flag[0]=FALSE;

} }


Void p1() / / process P1

{

while (TURE){

Flag[1]=TURE; turn=0;

While (flag[0]&&(turn==0))

Critical Section (CS);

Flag[1]=FALSE;

} }

where the initial values for the shared variables are:

boolean flag[2] ;

int turn=0;

flag[0]=false; flag[1]=false;


The above implementation of P0 and P1 guarantees ()


A) both mutual exclusion for CS access and bounded-waiting for entry to CS

B) neither mutual exclusion for CS access, nor bounded-waiting (non-starvation) for entry to CS

C) mutual exclusion for CS access, but not bounded-waiting for entry to CS

D) bounded-waiting for entry to CS, but not mutual exclusion for CS access



please provide explanation for your answer.

please only answer id you are sure of the answer thank you.

In: Computer Science

using recursion no loops allowed(for,while..ect) not allowed #4: Write a recursive function ‘bool palindrome(string s)’ that...

using recursion
no loops allowed(for,while..ect) not allowed

#4: Write a recursive function ‘bool palindrome(string s)’ that returns true if s is a palindrome and false if not.


#5: Write a recursive function 'void reverse(string &word)' that reverses the given input string.

string name = "damian";
reverse(name);
cout << name << endl;  //should display "naimad".

#6: Write a function 'string binary(int n)' that returns a string of 1's and 0's which is the binary representation of n.

cout << binary(43) << endl; // 101011

#7: Write a function 'int numTwos(int n)' which returns the number of 2's in the base-4 expansion of n.

cout << numTwos(2170) << endl; // 3

c++

In: Computer Science

Java Programming (8th Edition) Joyce Farrell p.530, Chapter 10 Problem 1E with user input with scanner...

Java Programming (8th Edition) Joyce Farrell p.530, Chapter 10 Problem 1E with user input with scanner and the following results:

Enter name of horse: ABC
Enter color of horse: Red
Enter year: 2000
Enter name of horse: DEF
Enter color of horse: Blue
Enter year: 2010
Enter number of races: 6
ABC is red and born in 2000.
DEF is blue and born in 2010.
DEF completed 6 races..

In: Computer Science

This week’s journal articles focus on empowering leadership and effective collaboration in geographically dispersed teams, please...

This week’s journal articles focus on empowering leadership and effective collaboration in geographically dispersed teams, please answer the following questions:

How do geographically dispersed teams collaborate effectively?

Please find at least three tools on the market that teams can use to collaborate on a geographically dispersed team. Please note the pros and cons of each tool.

In: Computer Science

Suppose you need to transfer some data ensuring integrity and authentication and confidentiality of data. Explain...

Suppose you need to transfer some data ensuring integrity and authentication and confidentiality of data. Explain the steps.

Please don't provide handwritten solution for this question.

In: Computer Science

You are working as a Security Engineer in ABX Company Pvt. Ltd. Suddenly, intruder has got...

You are working as a Security Engineer in ABX Company Pvt. Ltd. Suddenly, intruder has got access to their database and used them to impersonate users to get some documents. Fortunately, attack was identified and the stopped by your team. Now, your manager asked you to find a secure way to store password securely and others could not able to reverse it or use it for login. What will be your solution? Would you use hashing? If you use hashing please explain the steps.

In: Computer Science