Skip to content

Instantly share code, notes, and snippets.

@Igaurav31
Igaurav31 / dfs bfs.py
Last active June 1, 2023 18:39
dfs bfs
graph = {
'A': ['B', 'C'],
'B': ['A', 'D', 'E'],
'C': ['A', 'F'],
'D': ['B'],
'E': ['B', 'F'],
'F': ['C', 'E']
}
# # Take input for the graph
@Igaurav31
Igaurav31 / helpers.c
Created February 9, 2023 09:17
CS50X Week 4 - Memory - Lab 4 : Smiley solution
#include "helpers.h"
void colorize(int height, int width, RGBTRIPLE image[height][width])
{
//going through each pixel using the 2-D array.
for (int i = 0; i < height; i++)
{
for (int j = 0; j < width; j++)
{
image[i][j].rgbtBlue = 0x10;
#include <iostream>
#include <cstdlib>
bool valueOfZ(int x, int y, int z){
int temp = abs(2*x - 2*y);
if (z==temp){
return true;
}else{
return false;
}