homework

what are the algorithm differences between JPEG and GIF??

I am currently doing an assigment and cannot find the answer to this question..as Algorithm is supposed to mean (solving problems as such) ...

Simple FlowLayOut Help

I have a few questions for this program, one the first thing I am trying to do is make it so it could compare and see if the textfield is equal to the colorValues[x] position. The second issue is the if statement says if inText == to colorValues.length - 1 to open a box that says congradulations that does not work either. 3rd issue even ...

upper bound, lower bound

What does it mean to prove an upper bound or lower bound to an algorithm? ...

Java: Reading a file and storing data in an array, then find lowest decimal value

I have a homework problem Im 75% done with. My problem is that I cannot find a way to correctly display the correct value for the lowest population value and the province that has it. (Thanks in advance.): * Write a program to read in the province data file into an array called provinceName and an array called provincePopulations. Y...

Java Swing questions regarding GridLayout and paintComponent methods

Within this program, we need to create an 8x8 grid of "LifeCell" widgets. The instructor did not mention that the widgets had to be an object of Shape so I went ahead and used the GridLayout class. The GridLayout class works fine (as well as I know, since there is no visual aid to confirm.) The object of the program is to play the Game o...

Integer Problem in MIPS assembly

Using MIPS assembly if I prompt a user to input an integer how can I then take that integer and break it up into it's requisite parts? Example: # User inputs a number li $v0, 5 # read value of n syscall I then store the value in $v0 in a temporary register, say $t0, and need to break it up into each part that...

What happens at this object Initialization?

I do an object initialization as done in the code below: namespace PatternPractice { public class TestClass { private DecoratorClass decoratorClass; public TestClass() { } public void addTest() { decoratorClass = new DecoratorClass(); testMethod(decoratorClass); } public void testMeth...

How to spot empty parking spaces?

I want to do a final year B.Sc project on parking space detection. Can anybody give me some link related to it? Any text-book, tutorial or anything? What would be prerequisite for this project? What type of skills(programming/math) are needed? What are the initial steps to do? What type of readings(algorithms of image processing)...

Weird Scanf Issue

I am trying to finish a homework program that compares a string with a text file, so the user can essentially search the text file for the search term (string) in the file. I'm getting there :) However today I'm running into a very weird issue. When it asks for the term to search for I input the text, but it never ends. I could type all...

Homework: Generating Graphs

I need to simulate a discrete event simulator and for that I need to generate a network consisting of 30 nodes and then check if the generated graph is directed or not. Can anyone guide me on how to start with this. I should not be using the boost library to do this. Yes this is an assignment, I need an advice to start with. I just need ...

Recursive binary to decimal function without pow() or loops

I am doing a C course. I need to do a recursive XOR binary but I have some limitations. I can't use loop or any math.h functions, nor can I call another function from the XOR function. This is the function prototype: int binaryXor(int firstnumber[], int secondnumber[], int length); where firstnumber and secondnumber are arrays with t...

Text replacing with JS

I need to replace text entered in textarea with other characters, that I will call. For example, I need to replace the text, that I will enter to the textarea by clicking some button calls "change text" using JavaScript and it will change, for example, character "a" to "1", "b" to "2", "c" to "3" etc. ...

Deleting from arraylist and exporting back to .buab file(Java)

Ive made an address book. I can currently write to the arraylist and save it back to the .buab file, but I cant delete from the arraylist and export it back to the .buab file? Im pretty much stuck on this. Im able to retrive contacts from the .buab and scroll through them using the JTextFields and buttons ive created. Any help will be ...

For each with my custom class won't work

Hey everybody I'm working with java, So I am writing a class called ordered set. It is a class that is cross between a set and a queue. In other words, it is a queue without any duplicates. So I know I have to implement the Iterable interface, and write an iterator method. To write the method I have to then implement the iterator interfa...

What may cause losing object at the other end of a pointer in c++?

EDIT: I have found the error: I did not initialize an array with a size. question can be closed. I have a class V, and another class N. An object of N will have an array of pointers to objects of class V (say V **vList). So, N has a function like V **getList(); Now in some function of other classes or simply a driver function, if I ...

how to partition the 2d arrays among the processes for "The Game of Life"

I am doing an assignment using MPI to implement Game of Life. I was wondering if I should use a block-row partitioning, a cyclic row partitioning or a block-checkerboard partitioning? ...

Finding sorted sub-sequences in a permutation

Given an array A which holds a permutation of 1,2,...,n. A sub-block A[i..j] of an array A is called a valid block if all the numbers appearing in A[i..j] are consecutive numbers (may not be in order. Given an array A= [ 7 3 4 1 2 6 5 8] the valid blocks are [3 4], [1,2], [6,5], [3 4 1 2], [3 4 1 2 6 5], [7 3 4 1 2 6 5], [7 3 4 1 2 6 5 ...

When was this clock bought?

The clock on the gym wall also shows the day name and the day of the month. This morning it showed Tuesday - 23. The day obviously rotates through a cycle of 7 - and showed "Tuesday" correctly. The day of the month, though, presumably rotates through a cycle of 31 and showed "23" incorrectly - today is the 1st December (ie. not the 31s...

VHDL - Problem with std_logic_vector

Hi, i'm coding a 4-bit binary adder with accumulator: library ieee; use ieee.std_logic_1164.all; entity binadder is port(n,clk,sh:in bit; x,y:inout std_logic_vector(3 downto 0); co:inout bit; done:out bit); end binadder; architecture binadder of binadder is signal state: integer range 0 to 3; signal sum,cin:...

matches in a two dimensional array

how to found all matches in a two dimensional array? java ...