public class Main { public static void main(String[] args) {
// Breadth FS = Traverse a graph level by level // Utilizes a Queue // Better if destination is on average close to start // Siblings are visited before children
// Depth FS = Traverse a graph branch by branch // Utilizes a Stack // Better if destination is on average far from the start // Children are visited before siblings // More popular for games/puzzles
I've been trying to figure out how to implement this for a couple of days now until your video popped up, thank you so much. So many explanations are incredibly technical and don't really explain the practicality of it very well
Bro code, I'm learning python ( watching your 12h course) and I got an idea to do a brute force attack on a website, I searched on github and youtube but when I try the code it doesn't work. Can you do a video on how to do a brute force attack and what are python libraries and how they work?
@@BroCodez Also, im 15 and I want to learn a programming language but I dont what language and should I learn multiple languages? Am i too late to learn programming
Hey bro, can you make a guide for JPackage (making an installable .exe out of a .jar) I've seen many tutorials and docs but still have problems with it
Hello bro, really appreciate what you are doing. I want to ask if you have any knowledge about machine learning field, please make video about it. Thank you
public class Main {
public static void main(String[] args) {
// Breadth FS = Traverse a graph level by level
// Utilizes a Queue
// Better if destination is on average close to start
// Siblings are visited before children
// Depth FS = Traverse a graph branch by branch
// Utilizes a Stack
// Better if destination is on average far from the start
// Children are visited before siblings
// More popular for games/puzzles
Graph graph = new Graph(5);
graph.addNode(new Node('A'));
graph.addNode(new Node('B'));
graph.addNode(new Node('C'));
graph.addNode(new Node('D'));
graph.addNode(new Node('E'));
graph.addEdge(0, 1);
graph.addEdge(1, 2);
graph.addEdge(1, 4);
graph.addEdge(2, 3);
graph.addEdge(2, 4);
graph.addEdge(4, 0);
graph.addEdge(4, 2);
graph.print();
graph.breadthFirstSearch(0);
}
}
import java.util.*;
public class Graph {
ArrayList nodes;
int[][] matrix;
Graph(int size){
nodes = new ArrayList();
matrix = new int[size][size];
}
public void addNode(Node node) {
nodes.add(node);
}
public void addEdge(int src, int dst) {
matrix[src][dst] = 1;
}
public boolean checkEdge(int src, int dst) {
if(matrix[src][dst] == 1) {
return true;
}
else {
return false;
}
}
public void print() {
System.out.print(" ");
for(Node node : nodes) {
System.out.print(node.data + " ");
}
System.out.println();
for(int i = 0; i < matrix.length; i++) {
System.out.print(nodes.get(i).data + " ");
for(int j = 0; j < matrix[i].length; j++) {
System.out.print(matrix[i][j] + " ");
}
System.out.println();
}
System.out.println();
}
public void breadthFirstSearch(int src) {
Queue queue = new LinkedList();
boolean[] visited = new boolean[matrix.length];
queue.offer(src);
visited[src] = true;
while(queue.size() != 0) {
src = queue.poll();
System.out.println(nodes.get(src).data + " = visited");
for(int i = 0; i < matrix[src].length; i++) {
if(matrix[src][i] == 1 && !visited[i]) {
queue.offer(i);
visited[i] = true;
}
}
}
}
}
public class Node {
char data;
Node(char data){
this.data = data;
}
}
F
Practicing(Coding line by line)
public class Main
{
public static void main (String[]args)
{
Graph graph = new Graph (5);
graph.addNode (new Node ('1'));
graph.addNode (new Node ('2'));
graph.addNode (new Node ('3'));
graph.addNode (new Node ('4'));
graph.addNode (new Node ('5'));
graph.addEdge (0, 1);
graph.addEdge (1, 2);
graph.addEdge (2, 3);
graph.addEdge (2, 4);
graph.addEdge (4, 0);
graph.addEdge (4, 2);
graph.print ();
graph.breadthFirstSearch(2);
}
}
***************************
import java.util.*;
public class Graph
{
ArrayList < Node > nodes;
int[][] matrix;
Graph (int size)
{
nodes = new ArrayList ();
matrix = new int[size][size];
}
public void addNode (Node node)
{
nodes.add (node);
}
public void addEdge (int src, int dst)
{
matrix[src][dst] = 1;
}
public boolean checkEdge (int src, int dst)
{
if (matrix[src][dst] == 1)
{
return true;
}
else
{
return false;
}
}
public void print ()
{
System.out.print (" ");
for (Node node:nodes)
{
System.out.print (node.data + " ");
}
System.out.println ();
for (int i = 0; i < matrix.length; i++)
{
System.out.print (nodes.get (i).data + " ");
for (int j = 0; j < matrix[i].length; j++)
{
System.out.print (matrix[i][j] + " ");
}
System.out.println ();
}
System.out.println ();
}
public void breadthFirstSearch(int src){
Queuequeue = new LinkedList();
boolean[] visited = new boolean[matrix.length];
queue.offer(src);
visited[src] = true;
while(queue.size() != 0) {
src = queue.poll();
System.out.println(nodes.get(src).data + "= visited");
for(int i = 0; i < matrix[src].length; i++){
if(matrix[src][i]== 1 && !visited[i]){
queue.offer(src);
visited[i] = true;
}
}
}
}
}
***********************************
public class Node{
char data;
Node(char data){
this.data = data;
}
}
@@joyceasante8292 can u make for list adj?
Most underrated coding channel on TH-cam
I've been trying to figure out how to implement this for a couple of days now until your video popped up, thank you so much. So many explanations are incredibly technical and don't really explain the practicality of it very well
Been watching your videos all year and now you're really saving me from my Discrete math class.
Informative and easy to understand! Good points in the end too
Thanks for the tutorial bro. 😇
Bro please make a design and analysis of algorithms, playlist
Good 👍👍
You are the best:)
my bro your student is here
you're really good !!
Hey Make React Js Course bro with node js backend
Can you do a tutorial for Dijkstra's Algorithm
Super
great vid!
Hey Bro can you do some more C# videos? For example LINQ queries ?
sweeeet
I am confused with why does my lecture needs 40minutes to explain this and I could not understand anything he talked about.
Bro code, I'm learning python ( watching your 12h course) and I got an idea to do a brute force attack on a website, I searched on github and youtube but when I try the code it doesn't work. Can you do a video on how to do a brute force attack and what are python libraries and how they work?
I don't know anything about hacking, unfortunately xD
@@BroCodez can you do a video on python libraries
@@BroCodez Also, im 15 and I want to learn a programming language but I dont what language and should I learn multiple languages? Am i too late to learn programming
@@adheesh2secondsago630 Thank you, it means a lot!
I'm a bit heartbroken. This video didn't start with "Hey everyone, it's your bro". :(
Hey bro, can you make a guide for JPackage (making an installable .exe out of a .jar)
I've seen many tutorials and docs but still have problems with it
Another session with the Brofessor. Class is in Session.
Hello bro, really appreciate what you are doing. I want to ask if you have any knowledge about machine learning field, please make video about it. Thank you
Thanks!
Where did my comment go?
Hello
I'm early today
ഒരു ഹലോ തരാമോ 🌚
Nop
:((
:))