1,550 Answered Questions for the topic computer science
03/15/21
Modify the Cage class to implement Comparable.
The definition of the Comparable interface can be found here. Remember that Comparable has one abstract method, int compareTo(T o). Two Cages can be compared based on their size obtained via...
more
03/15/21
Write a function in Java that takes in the int[] array, sorts it using bubble sort, then returns back the sorted array.
Examples:
bubbleSort({4,7,1}) -> {1,4,7}
bubbleSort({80,6,6,8,2}) -> {2,6,6,8,80}
public int[] bubbleSort(int[] array) { int n = array.length; int temp = 0; }Finish the rest
Computer Science Discrete Math
03/15/21
Deterministic Finite Automata or Nondeterministic Finite Automata
Deterministic Finite Automata or Nondeterministic Finite Automata that accepts the set of strings in ∑ = {0,1} such that every substring of length 4 contains at least three 1s.
Computer Science Computer Engineering
03/15/21
Develop a C++ code, which performs the following operations on a doubly link list:
Function 1: Delete the middle node if the length of the list is odd.Function 2: Delete the middle 2 nodes if the length of the list is even.Function 3: Update the value of 2nd nodeFunction 4:...
more
Computer Science Computer Programming
03/15/21
Big Oh Notation
What is the running time for: -Linear Search-Binary search-bubble sortFor each algorithm above, why do they take the time that they do?
03/14/21
Proof by induction. Imagine that we are going to prove by induction that:
(1/sqrt(1)) + (1/sqrt(2)) + (1/sqrt(3)) + ... + (1/sqrt(n)) >= sqrt(n), for all n E Z^+Assume by the inductive step that:(1/sqrt(1)) + (1/sqrt(2)) + (1/sqrt(3)) + ... + (1/sqrt(k)) >=...
more
03/13/21
If a simple, connected graph has 20 vertices, what is the maximum number of edges it can have?
(Recall that a simple graph does not have loops and does not have multiple / parallel edges)
03/13/21
A binary tree is a connected graph with no cycles, where each vertex has a degree less than or equal to 3.
What is the maximum number of vertices of degree one that a binary tree with 15 vertices can have?
03/13/21
Suppose you owe 10 dollars to a friend. Each week you pay your friend at least 1 dollar back.
Sometimes however you might pay your friend back 2 dollars in a week and other times you might pay your friend 5 dollars in a week. How many different payment sequences are possible? Here are a...
more
03/13/21
Recall the one-to-one and onto mapping of the set of natural numbers to the set of integers.
We used this mapping to show that the integers were countably infinite. Find a function, f(n) that gives the nth integer of the given mapping below. You may find it useful to know that the floor(x)...
more
03/13/21
At an annual board meeting company X is deciding whether or not to take the company public.
Each board member can vote "yes", "no", or "abstain". If there are n-board members, then how many different ways can the votes be cast? Express your answer as a recursive function, f(n). Don't...
more
03/12/21
Algebra 1 Question
A rectangular yard has an area of x^2 +12x−64 , find the dimensions of the yard.
Algebra 1 Question
If (x−2)(x−a) multiplies to x^2 −6x+8, then which of the following is the value of a.Does A equal 4, 6, -4 or -6
Work out what this is in mls/hour then mls/24 hours (day). Show your workings
I need help with this question
03/06/21
NEED HELP ASAP!!
How do I put the prices for the toppings, pizza size, and drinks in HTML and Javascript code?I used the radio button for the pizza toppings (Pineapple, Cheese, and Black Olives) and pizza sizes...
more
03/04/21
PYTHON: How to scale color channels of an imported image to find the area fraction within certain indices (see below)?
Question 1.2: Scale the red channel by 150 C, the green channel by 90 C, and the blue channel by 40 C. Add the contribution of each channel to compute the resulting temperature. Calculate the area...
more
Computer Science
03/04/21
The function f(x)=x^3-2x-1 has a root in the interval
Computer Science Discrete Math
03/04/21
Graphs- Computer Science
What is the number of connected components in the graph specified by the following adjacency matrix representation? 0 1 1 0 0 0 01 0 1 0 0 0 01 1 0 0 0 0 00 0 0 0 1 0 00 0 0 1 0 1 10 0 0 0 1 0 10 0...
more
03/02/21
Fractional Numbers and Blackboard Notation.
Infinite binary expansions of rational numbers are either pure recurring ormixed recurring depending on whether the cycle starts immediately after thepoint (pure recurring), or somewhat later...
more
03/02/21
Algebra Write and Solve Inequalities in Context
A group of friends wants to go to the amusement park. They have no more than $85 to spend on parking and admission. Parking is $15.25, and tickets cost $11.25 per person, including tax. Write and...
more
03/01/21
Help with Computer Science assignment
#1.Create the Hello World program using vi. Save it in your home directory. Instead of the using the “Hello World!” in cout, replace it with “Hello, your name!”Compile the program using g++. This...
more
Computer Science Discrete Math
03/01/21
Greedy Algorithm
No complicated code: English is the best way to express an algorithm combined with some simple pseudocode when needed. We want to purchase an item of price M and for that we have an...
more
02/28/21
Linux urgent question please answer ASAP
Your menu will be surrounded by a loop, either the until or while loop, so that when one option is concluded it will go back to the main menu until the user selects an option x to exit....
more
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.