I need some help with a program I'm trying to make for my final project in my programming class.
This is a discussion on Any Java programmers? within the Off Topic forums, part of the Entertainment category; I need some help with a program I'm trying to make for my final project in my programming class....
Page: 1
I need some help with a program I'm trying to make for my final project in my programming class.
I know Java from my university classes. I might be able to help. Get me on MSN, [email protected] or AIM, TrianLynx713
I can help also
i have AP Computer Science AB exam tomorrow 2nd lvl
He fixed the problem btw
I need help though, hehe.
i'm busy making my Java project to :lol:
it's so frustrating when it doesn't want to work, i'm trying to get my SQL statements right, but they're a pain in the ass.
Can I add you too? :PI know Java from my university classes. I might be able to help. Get me on MSN, [email protected] or AIM, TrianLynx713[/b]
I need help with an array loop..
Sure, np Torr ^^Can I add you too? :P
I need help with an array loop..[/b]
Anyone know how to code a breadth-first search of an undirected graph? This is my code and for some reason it only checks one node and exits, then fails elsewhere cuz it didn't traverse the entire graph.
Code:private static void computePath() { ****Vertex start=network.getVertex("NODE1"); //getVertex() returns vertex instance associated with the String key ****LinkedList<Vertex> currentPath=new LinkedList<Vertex>(); ****currentPath.add(start); ****start.setMark(Vertex.Mark.VISITED); //setMark() sets an enum mark ****while (!currentPath.isEmpty()) { ********Vertex head=currentPath.get(0); ********currentPath.remove(); ********try { ************LinkedList<Vertex> neighbors= ****************(LinkedList<Vertex>)network.getNeighborVertices(head); //getNeighborVertices() returns a collection of vertice instances that neighbor the Vertex key ************for (Vertex neighbor: neighbors) { ****************Edge edge=network.getEdge(head.getName(), neighbor.getName()); //getEdge() returns the Edge instance associated with the two vertice String keys ****************if (edge.getMark()==Edge.Mark.UNEXPLORED){ ********************Vertex w=network.getVertex(edge.getFrom());; ********************if (edge.getFrom().compareTo(head.getName())==0) { //getFrom() returns the String key that is one vertex of the Edge ************************w=network.getVertex(edge.getTo()); ********************} ********************if (head.getMark()==Vertex.Mark.UNEXPLORED){ ************************edge.setMark(Edge.Mark.DISCOVERY); ************************head.setMark(Vertex.Mark.VISITED); ************************neighbor.setPredecessor(head); //setPredecessor() sets the Vertex predecessor used later to determine the path taken ************************currentPath.add(w); ********************} ********************else { ************************edge.setMark(Edge.Mark.CROSS); ********************} ****************} ************} ********} catch (NoSuchVertexException nsve) { ************nsve.printStackTrace(); ********} ****} ****path.clear(); ****Vertex currentNode=network.getVertex("NODE2"); ****path.add(currentNode); ****while (currentNode.getPredecessor()!=null) { ********path.add(currentNode.getPredecessor()); ********currentNode=currentNode.getPredecessor(); ****} }
to much for me :lol:Sure, np Torr ^^
Anyone know how to code a breadth-first search of an undirected graph? This is my code and for some reason it only checks one node and exits, then fails elsewhere cuz it didn't traverse the entire graph.[/b]
i'm already having a hard time getting my database to communicate with my application
Bookmarks