project-2's People
project-2's Issues
Devin Romanoff - Code Review
Project-2/com/neko/rug/Main.java
Lines 104 to 105 in 6404460
This seems redundant and can probably be reduced to one line.
Project-2/com/neko/rug/Main.java
Line 153 in 6404460
Having slightly more verbose/less abbreviated variable names could help with readability]
Project-2/com/neko/rug/Node.java
Lines 18 to 22 in 6404460
Might be redundant because nodeVal is already a string
Project-2/com/neko/rug/Graph.java
Line 9 in 6404460
Project-2/com/neko/rug/Graph.java
Lines 77 to 82 in 6404460
The LinkedList could be a redundant data structure because you can iterate through a HashSet to get all the nodes and manipulate them too
Project-2/com/neko/rug/GraphSearch.java
Lines 21 to 68 in 6404460
The assignment states that DFSRec should recursively return an ArrayList, so while this is a recursive DFS I'm not sure it fully complies with the problem statement
Project-2/com/neko/dag/Main.java
Lines 126 to 142 in 6404460
This switch is redundant because case 1 and 2 execute the same code
Project-2/com/neko/dag/TopSort.java
Lines 59 to 60 in 6404460
Is there an advantage of using a LinkedList over a Stack
Project-2/com/neko/dag/DirectCostNode.java
Lines 18 to 21 in 6404460
There should be a check in case an edge already exists
Project-2/com/neko/rug/GraphSearch.java
Lines 16 to 19 in 6404460
This operation could be performed in the constructor
Project-2/com/neko/rug/GraphSearch.java
Lines 168 to 173 in 6404460
You might save space by making bflr an ArrayList to begin with and returning that
Andrew Peters - Code Review
Project-2/com/neko/rug/Node.java
Lines 4 to 10 in 6404460
giving the Node class a visited variable would make it a lot easier to keep track of which nodes you have looked at already
Project-2/com/neko/rug/Main.java
Lines 86 to 90 in 6404460
for you random graph, you do not add n random nodes to the graph. you add specific nodes 1 through n
Project-2/com/neko/rug/Main.java
Lines 106 to 125 in 6404460
since you do the same code every time with just one of them having an additional break, you don't need a switch statement. you can just use an if statement and say if type == 0, then break
Project-2/com/neko/rug/GraphSearch.java
Lines 9 to 19 in 6404460
isn't it kinda redundant to have the method switchGraph? in your GraphSearch constructor you can just assign graphToSearch to the parameter
Project-2/com/neko/rug/GraphSearch.java
Lines 24 to 30 in 6404460
you can save memory space by making the helper method return an arraylist and just make nodeList an arraylist type
Project-2/com/neko/rug/GraphSearch.java
Lines 21 to 31 in 6404460
if you helper method ends up returning null, then the main function would return an empty list instead of null, and the question asked to return null if no path is found
Project-2/com/neko/dag/DirectedGraph.java
Lines 55 to 60 in 6404460
you should add some kind of check to make sure there is not already an existing edge from first to second
Project-2/com/neko/dag/Main.java
Lines 103 to 151 in 6404460
your random DAG code does not check to make sure it is not adding an edge backwards, so this could create a cycle in the graph, and a DAG is acyclic
Project-2/com/neko/dag/TopSort.java
Lines 58 to 60 in 6404460
you could save memory space by having a visited variable in the node class and just using a stack to track what you have processed
Project-2/com/neko/grid/GridGraph.java
Lines 24 to 36 in 6404460
you first check if node second is next to node first, and then you check which side the node second is on and then add as long as that side isn't an error. you probably don't need to have 2 separate checks to add the node. you can just have one check to determine what side node second is on, and if returns an error then you know that second is not a neighbor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.