Click here to Skip to main content
15,868,151 members
Home / Discussions / Java
   

Java

 
GeneralRe: Audio Steganography Pin
Member 129105895-Mar-17 23:27
Member 129105895-Mar-17 23:27 
GeneralRe: Audio Steganography Pin
Richard MacCutchan5-Mar-17 23:31
mveRichard MacCutchan5-Mar-17 23:31 
GeneralRe: Audio Steganography Pin
Member 129105895-Mar-17 23:56
Member 129105895-Mar-17 23:56 
GeneralRe: Audio Steganography Pin
Jhone Menezes10-Mar-17 20:17
Jhone Menezes10-Mar-17 20:17 
QuestionAnyone want to help with a project? Pin
jtrent2384-Mar-17 18:36
jtrent2384-Mar-17 18:36 
AnswerRe: Anyone want to help with a project? Pin
Richard MacCutchan4-Mar-17 20:37
mveRichard MacCutchan4-Mar-17 20:37 
AnswerRe: Anyone want to help with a project? Pin
Member 129105895-Mar-17 22:44
Member 129105895-Mar-17 22:44 
QuestionDijkstra's Algortihm Pin
Member 130380604-Mar-17 7:25
Member 130380604-Mar-17 7:25 
HI im tryin to implement dijkstra's algorithm in java but my output is not correct. The output should be [0,492,665,114,452,999] but i keep getting a different range.Can anybody help please as i need this for my assignment. Thnks

Java
public ArrayList <Integer> dijkstra (int start, int end) // start = 0 & end = 999
 {
   int N = adj.length;  
   HashMap <Integer,Double> Q = new HashMap <Integer,Double>();  // key,value

 ArrayList <Integer> [] paths = new ArrayList [N];   // paths[] 1000
 //System.out.println( "paths.Length" + paths.length); 

 for (int i=0;i<N;i++) // end = 999
 { 
    Q.put(i,Double.POSITIVE_INFINITY); // blank i = 0 to 999(keys/vertex)
   //System.out.println("Q @ [0]" +Q.get(999));

    paths[i]=new ArrayList <Integer>();

    paths[i] = new ArrayList<Integer>(start); // blank  distances
    
 } 
 
  HashSet <Integer> S= new HashSet();  // contains unique elements
  S.add(start); // blank 
  Q.put(start,Q.get(start));  //blank 
  

  while (!Q.isEmpty())
 {
  int v = findSmallest(Q);  // blank
  //System.out.println("key of Q " + v)
  
  if (v==end && Q.get(v)!= Double.POSITIVE_INFINITY)  // blank Q ! map to v
  return paths[end]; // blank
  
  double w = Q.get(v); // blank

  S.add(v); // blank

 for(int u: neighbours(v))
  if (!S.contains(u))
 {
  double w1= adj[u][v] + w; // adj contains all the weigths of the graph
 
  
  if (w1 < Q.get(u))
  {
   Q.put(u,w1);
   paths[u]= addToEnd(v,paths[u]);
  }
 }
 Q.remove(v);
 }
  return new ArrayList <Integer> ();
 }

AnswerRe: Dijkstra's Algortihm Pin
Patrice T9-Mar-17 15:39
mvePatrice T9-Mar-17 15:39 
Questionabout resultset in servlet or jsp Pin
loganDevil26-Feb-17 23:17
loganDevil26-Feb-17 23:17 
Rant[Repost] about resultset in servlet or jsp Pin
Richard Deeming26-Feb-17 23:38
mveRichard Deeming26-Feb-17 23:38 
Questioncan someone help me convert this source code to java code? Pin
rootyourpussy26-Feb-17 9:00
rootyourpussy26-Feb-17 9:00 
AnswerRe: can someone help me convert this source code to java code? Pin
NotPolitcallyCorrect26-Feb-17 9:22
NotPolitcallyCorrect26-Feb-17 9:22 
AnswerRe: can someone help me convert this source code to java code? Pin
Afzaal Ahmad Zeeshan26-Feb-17 10:08
professionalAfzaal Ahmad Zeeshan26-Feb-17 10:08 
QuestionAutomate Copy Paste of Items from Excel to Java Input Field Pin
ajw198517-Feb-17 0:51
ajw198517-Feb-17 0:51 
SuggestionRe: Automate Copy Paste of Items from Excel to Java Input Field Pin
Jochen Arndt17-Feb-17 1:14
professionalJochen Arndt17-Feb-17 1:14 
GeneralRe: Automate Copy Paste of Items from Excel to Java Input Field Pin
ajw198517-Feb-17 2:14
ajw198517-Feb-17 2:14 
GeneralRe: Automate Copy Paste of Items from Excel to Java Input Field Pin
Jochen Arndt17-Feb-17 2:23
professionalJochen Arndt17-Feb-17 2:23 
GeneralRe: Automate Copy Paste of Items from Excel to Java Input Field Pin
ajw198517-Feb-17 3:20
ajw198517-Feb-17 3:20 
GeneralRe: Automate Copy Paste of Items from Excel to Java Input Field Pin
Jochen Arndt17-Feb-17 21:04
professionalJochen Arndt17-Feb-17 21:04 
GeneralRe: Automate Copy Paste of Items from Excel to Java Input Field Pin
ajw198519-Feb-17 16:26
ajw198519-Feb-17 16:26 
GeneralRe: Automate Copy Paste of Items from Excel to Java Input Field Pin
Jochen Arndt19-Feb-17 20:50
professionalJochen Arndt19-Feb-17 20:50 
GeneralRe: Automate Copy Paste of Items from Excel to Java Input Field Pin
ajw198520-Feb-17 0:27
ajw198520-Feb-17 0:27 
GeneralRe: Automate Copy Paste of Items from Excel to Java Input Field Pin
Richard MacCutchan21-Feb-17 22:05
mveRichard MacCutchan21-Feb-17 22:05 
QuestionIncrement a char variable in Java Pin
Anda Cristea16-Feb-17 11:10
Anda Cristea16-Feb-17 11:10 

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.