Click here to Skip to main content
16,011,702 members
Home / Discussions / Java
   

Java

 
GeneralRe: jvm manager Pin
Richard MacCutchan30-Oct-09 23:16
mveRichard MacCutchan30-Oct-09 23:16 
QuestionWhy is my Java Code not compiling? Pin
srbruno27-Oct-09 16:47
srbruno27-Oct-09 16:47 
AnswerRe: Why is my Java Code not compiling? Pin
Adam Maras27-Oct-09 18:28
Adam Maras27-Oct-09 18:28 
AnswerRe: Why is my Java Code not compiling? Pin
Richard MacCutchan28-Oct-09 0:30
mveRichard MacCutchan28-Oct-09 0:30 
QuestionCode explanatoin Pin
WebMaster26-Oct-09 5:02
WebMaster26-Oct-09 5:02 
AnswerRe: Code explanatoin Pin
Richard MacCutchan26-Oct-09 6:07
mveRichard MacCutchan26-Oct-09 6:07 
Questionlet me know the path for html pages Pin
kirancgi26-Oct-09 4:42
kirancgi26-Oct-09 4:42 
QuestionRE: Please Comment on the Java Code and Make Revisions If Necessary Pin
srbruno25-Oct-09 12:16
srbruno25-Oct-09 12:16 
I need to know if my data structure classes have been properly created to accomplish the following:

I am trying to represent a matrix as a 1-dimensional array of Lists. Each List will represent one row of the Matrix, but only the non-zero entries will be stored. List elements must store the matrix entries and its column location. For example, the matrix below would have the following representation as an array of Lists.
| 0.0 4.0 5.0 |
M = | 3.0 0.0 0.0 |
| 1.0 0.0 2.0 |

1: (1, 1.0) (3, 2.0)
Array of Lists = 2: (1, 3.0)
3: (2, 4.0) (3, 5.0)

I have created two classes in different ADT files: The Matrix class and the List class. The goal is to create a two dimensional matrix as an array of Lists of Entry Objects. More specifically, the Matrix will be an array of deque linked list of Entry Objects. Only non-zero entries will be stored in the Matrix class. Therefore, the linked list (representing the rows of the matrix) is dynamically created since the entries of the matrix can be entered in any order. Entries are identified by their row, column, and value attributes.


Matrix.java code:
class Matrix
{
private class Entry
{ int col;
double val;

// Entry Constructor
Entry (int c, double v) {
this.col = c; this.val = v;
}
}
}


List.java code:
class List
{
private class Node
{ Object obj;
Node next, prev;

// Node Constructor
Node (Object o) { this.obj = o; next = prev = null; }
}

// List Fields
private Node front, back, current;
private int row, length;

// List Constructor
List(int r)
{ front = back = current = null;
this.row = r; this.length = 0;
}
}
AnswerRe: RE: Please Comment on the Java Code and Make Revisions If Necessary Pin
Nagy Vilmos25-Oct-09 22:54
professionalNagy Vilmos25-Oct-09 22:54 
Questioncount if statement Pin
Shakirin Amin25-Oct-09 11:18
Shakirin Amin25-Oct-09 11:18 
AnswerRe: count if statement Pin
Richard MacCutchan25-Oct-09 12:55
mveRichard MacCutchan25-Oct-09 12:55 
GeneralRe: count if statement Pin
Shakirin Amin26-Oct-09 5:11
Shakirin Amin26-Oct-09 5:11 
QuestionGantt Chart's Task Bar Pin
sorrol24-Oct-09 23:48
sorrol24-Oct-09 23:48 
AnswerRe: Gantt Chart's Task Bar Pin
427748025-Oct-09 0:00
427748025-Oct-09 0:00 
GeneralRe: Gantt Chart's Task Bar Pin
sorrol25-Oct-09 16:27
sorrol25-Oct-09 16:27 
QuestionPractical numbers Pin
rics 224-Oct-09 22:35
rics 224-Oct-09 22:35 
AnswerRe: Practical numbers Pin
Richard MacCutchan24-Oct-09 23:23
mveRichard MacCutchan24-Oct-09 23:23 
AnswerRe: Practical numbers Pin
427748025-Oct-09 0:01
427748025-Oct-09 0:01 
AnswerRe: Practical numbers Pin
yohoprashant7-Nov-09 5:37
yohoprashant7-Nov-09 5:37 
QuestionNeed to Confirm Creation of a Array List of Entry Objects Pin
srbruno24-Oct-09 15:57
srbruno24-Oct-09 15:57 
AnswerRe: Need to Confirm Creation of a Array List of Entry Objects Pin
427748025-Oct-09 0:03
427748025-Oct-09 0:03 
QuestionBeginner to java Pin
ammu2324-Oct-09 5:05
ammu2324-Oct-09 5:05 
AnswerRe: Beginner to java Pin
Nuri Ismail24-Oct-09 5:51
Nuri Ismail24-Oct-09 5:51 
GeneralRe: Beginner to java Pin
ammu2326-Oct-09 19:59
ammu2326-Oct-09 19:59 
Question5 drawings in 5 rectangular regions within one window Pin
WebMaster23-Oct-09 20:19
WebMaster23-Oct-09 20:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.