- Name : Samagra Gupta
- Username : samagragupta
- Profile link : http://github.com/samagragupta/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%{ | |
#include <cstdio> | |
#include "pikaC.tab.h" // to get the token types from Bison | |
#include <string.h> | |
#include <stdlib.h> | |
char* strdup (const char* s) | |
{ | |
size_t slen = strlen(s); | |
char* result = (char*) malloc(slen + 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
global_hillClimbing = 1 | |
global_beamSearch = 1 | |
global_variableNeighbourhoodDescent = 1 | |
def clauseGen(n, m, k): | |
var = [] | |
clauses = [] | |
doneVars = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<bits/stdc++.h> | |
#include<iostream> | |
using namespace std; | |
const int MAX=26; | |
int main() | |
{ | |
int k,n,m; | |
cout<<"k="; | |
cin>>k; | |
cout<<"n="; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
parent = None | |
def __init__(self,state): | |
self.state = state | |
def setParent(self,parent): | |
self.parent = parent | |
def Backtrack(p): | |
count=0 | |
while p.parent!=None: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
parent = None | |
def __init__(self,state): | |
self.state = state | |
def setParent(self,parent): | |
self.parent = parent | |
def BackTrack(p): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
parent = None | |
def __init__(self,state): | |
self.state = state | |
def setParent(self,parent): | |
self.parent = parent | |
def Backtrack(p): | |
count=0 | |
while p.parent!=None: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
parent = None | |
def __init__(self,state): | |
self.state = state | |
def setParent(self,parent): | |
self.parent = parent | |
def BackTrack(p): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
parent = None | |
def __init__(self,state): | |
self.state = state | |
def setParent(self,parent): | |
self.parent = parent | |
def BackTrack(p): |