Skip to content

Instantly share code, notes, and snippets.

View vinpalace's full-sized avatar
🎯
Focusing

Moturu Vineeth vinpalace

🎯
Focusing
View GitHub Profile
@RuolinZheng08
RuolinZheng08 / backtracking_template.py
Last active June 6, 2024 22:47
[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())
/* 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;
@mycodeschool
mycodeschool / Queue_CircularArrayImplementation.cpp
Last active May 25, 2024 10:46
Queue - Array Implementation
/* Queue - Circular Array implementation in C++*/
#include<iostream>
using namespace std;
#define MAX_SIZE 101 //maximum size of the array that will store Queue.
// Creating a class named Queue.
class Queue
{
private:
int A[MAX_SIZE];