Skip to content

Instantly share code, notes, and snippets.

View vinpalace's full-sized avatar
🎯
Focusing

Moturu Vineeth vinpalace

🎯
Focusing
View GitHub Profile
@vinpalace
vinpalace / backtracking_template.py
Created September 9, 2021 09:09 — forked from RuolinZheng08/backtracking_template.py
[Algo] Backtracking Template & N-Queens Solution
def is_valid_state(state):
# check if it is a valid solution
return True
def get_candidates(state):
return []
def search(state, solutions):
if is_valid_state(state):
solutions.append(state.copy())
### Keybase proof
I hereby claim:
* I am vinpalace on github.
* I am vineethmoturu (https://keybase.io/vineethmoturu) on keybase.
* I have a public key ASBAGxJxR9G9nPHuUOOXRJDDJJrG1YZM5u7G--Pi1ysFYgo
To claim this, I am signing this object:
/* Merge sort in C */
#include<stdio.h>
#include<stdlib.h>
// Function to Merge Arrays L and R into A.
// lefCount = number of elements in L
// rightCount = number of elements in R.
void Merge(int *A,int *L,int leftCount,int *R,int rightCount) {
int i,j,k;