Tags » BF's

Post Offices

Given a 2D city blocks and a list of post offices coordinates. Calculate the minimum distance each block to the nearest post officies.

BFS

Initialize all cells to -1, meaning the distances all need to be determined. 73 more words

BFS (Best Friend Syndrome)

I guess I have always fallen hard and fast, but it’s more than just in love. Anytime I meet someone and have a connection, I go overboard. 460 more words

Sundown - Chapter 16 (Part 1)

Ayanna opened the front door to her house and invited General Reiss inside. He took a seat over in the living room as Ayanna sat down in the chair across from him. 2,154 more words

Writing

Christina's World

I’ve always had an affinity for Andrew Wyeth paintings.  Something about the isolation of the coastal Maine settings he used struck a chord with me.  This particular painting “Christina’s World” was always one of my favorites.  202 more words

Sundown - Chapter 15 (Part 1)

(Noa’s Loss)

I still remember that day vividly. It was like a ghost that refused to leave alone. The screams of the people around me as the houses burned to the ground still ring in my ears, as well as the sight of soldiers storming through and torturing people. 2,831 more words

Writing

BFS - C code

Github Link.

#include
#include 

/*
Funtion Name: bfs
Input Params: Graph input as matrix, number of vertices and source vertex
Return Type:  void
Description:  performs bfs traversal on the given graph
*/
void bfs(int m, int v, int source)
{
    /// A queue will be used during the traversal
    int queue;
    int front = 0;
    int rear = 0;

    /// Temporary variables
    int u;
    int i;

    /// Array to maintain the visited vertices
    int visited;

    /// Set all the vertices to not visited
    for (i= 0; i < v; i ++)
        visited[i] = 0;

    /// Initilaize the queue with source and mark it visited
    queue = source;
    visited = 1;

    printf("The BFS Traversal is... 120 more words
General Discussions