Skip to content

Instantly share code, notes, and snippets.

@sameer-j
sameer-j / UCF.cpp
Last active January 2, 2023 22:05
Uniform Cost Search Algorithm C++ Implementation
//Algorithm:
// Insert the root into the queue
// While the queue is not empty
// Dequeue the maximum priority element from the queue
// (If priorities are same, alphabetically smaller path is chosen)
// If the path is ending in the goal state, print the path and exit
// Else
// Insert all the children of the dequeued element, with the cumulative costs as priority
//url: https://algorithmicthoughts.wordpress.com/2012/12/15/artificial-intelligence-uniform-cost-searchucs/
#include <iostream>
@sameer-j
sameer-j / BFS.cpp
Created January 26, 2016 10:05
Breadth First Search Algorithm; C++ Implementation
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include<stdlib.h>
using namespace std;
class Graph
{
int V;
@sameer-j
sameer-j / BDS.cpp
Last active September 2, 2018 21:32
Bidirectional Search Implementation in C++
//Applies BFS from both source and destination side and checks after each iteration if the visited
//list from each side are intersecting at any point. If yes, then thats the meeting point and gives the
//path from source to that point and from that point to destination
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <stdlib.h>
using namespace std;
@sameer-j
sameer-j / setup.sh
Last active May 30, 2021 14:05 — forked from jjvillavicencio/setup.sh
Install Android SDK on Windows Bash (WSL)
# run commands one by one manually
cd ~
# add sudo wherever needed
apt-get update
apt-get install unzip zip
# get the link for latest sdk commandlinetools for linux from https://developer.android.com/studio#downloads "Command line tools only" section
wget https://dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip
# create folder Android and unzip the cmdtools in Android/cmdline-tools/latest/
unzip commandlinetools-linux-7302050_latest.zip -d Android
rm commandlinetools-linux-7302050_latest.zip
@sameer-j
sameer-j / rearct-native-app-in-wsl2.md
Last active May 30, 2021 14:33 — forked from bergmannjg/rearct-native-app-in-wsl2.md
Building a react native app in WSL2