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
from scipy.spatial import distance | |
class Vectors: | |
def __init__(self, dimensions): | |
self.vectors = [] | |
self.dimensions = dimensions | |
def add_vector(self, vector): | |
self.vectors.append(vector) | |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"strings" | |
"github.com/typesense/typesense-go/typesense" | |
) |
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
{ | |
"$id": "your-collection-id", | |
"$permissions": { | |
"read": [ | |
"*" | |
], | |
"write": [ | |
"*" | |
] | |
}, |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type Fetcher interface { | |
// Fetch returns the body of URL and | |
// a slice of URLs found on that page. |
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
package main | |
import "fmt" | |
import "golang.org/x/tour/tree" | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. | |
func walk(t *tree.Tree, ch chan int) { | |
if t.Left != nil { | |
walk(t.Left, ch) |
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<iostream> | |
using namespace std; | |
struct BST { | |
int k; | |
BST *left; | |
BST *right; | |
}; | |
class SplayTree { |
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<iostream> | |
using namespace std; | |
template<class T> | |
T* bubbleSort(T* v, int n) { | |
for(int i = 0; i < n - 1; ++i) { | |
for(int j = 0; j < n - i - 1; ++j) { | |
if(v[j] > v[j + 1]) { | |
float temp = v[j]; | |
v[j] = v[j + 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
Show hidden characters
{ | |
"cmd": "g++ -std=c++17 $file_name -o exe && timeout 10s ./exe </home/thirusenthil/CP/in.txt > /home/thirusenthil/CP/out.txt", | |
"selector": "source.c++", | |
"shell": true, | |
"working_dir" : "$file_path" | |
} |
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<stdio.h> | |
#include<stdlib.h> | |
struct node | |
{ | |
char info; | |
struct node *ptr; | |
}*front,*rear,*temp,*front1, *prevFront; | |
void enq(char data); |
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<stdio.h> | |
#include<string.h> | |
//Check if palindrome | |
char queue[100]; | |
int front= -1; | |
int rear= -1; | |
int enqueue(char c){ | |
if(front==-1&&rear==-1){ | |
front=rear=0; | |
} |