Skip to content

Instantly share code, notes, and snippets.

View sortira's full-sized avatar
🎯
Focusing

Aritro Shome sortira

🎯
Focusing
View GitHub Profile
@sortira
sortira / bible.txt
Created November 20, 2025 05:34
all assignments
https://tinyurl.com/stringarithmetic
https://tinyurl.com/famousstring
https://tinyurl.com/famousstringtwo
https://tinyurl.com/sparsematrixaritro
https://tinyurl.com/upperlowersparse
https://tinyurl.com/insertionselectionsort
https://tinyurl.com/avltreeass
https://tinyurl.com/threadedbinarytree
https://tinyurl.com/priorityqass
https://tinyurl.com/circularqueueass
@sortira
sortira / stackper.c
Created November 20, 2025 05:29
generate stack perm
#include <stdio.h>
#include <stdlib.h>
#define MAX 100
void generate(int input[], int n, int in,
int stack[], int top,
int output[], int out) {
//if input and stack empty we reached base case
if (in == n && top == -1) {
@sortira
sortira / stacksort.c
Created November 20, 2025 05:27
sort stack
#include <stdio.h>
#include <stdlib.h>
#define MAX_SIZE 100
typedef struct {
int buffer[MAX_SIZE];
int top;
} stack;
void init(stack* s) {
@sortira
sortira / bstwordsort.c
Created November 20, 2025 05:26
bst word sort
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct node_t
{
char *word;
struct node_t *left;
struct node_t *right;
};
struct node_t *create_node(char *new_word)
@sortira
sortira / arrayLL.c
Created November 20, 2025 05:25
array LL insertion
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#define MAX_N 10000
typedef struct Node {
int data;
struct Node *next;
@sortira
sortira / tree.c
Created November 20, 2025 05:22
tree print
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX_SIZE 15
typedef struct
{
int data[MAX_SIZE];
int top;
} stack_t;
void initialize_stack(stack_t *s);
@sortira
sortira / bst.c
Created November 20, 2025 05:16
bst
#include <stdio.h>
#include <stdlib.h>
typedef struct node
{
int data;
struct node *left;
struct node *right;
} Node;
@sortira
sortira / hash.c
Created November 20, 2025 05:15
hashing
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#define SIZE 10001
int M;
//hash func as discussed in class
int h_k(int k) {
return k % M;
@sortira
sortira / qs.c
Created November 20, 2025 05:13
quicksort.c
#include<stdlib.h>
#include<stdio.h>
#include<time.h>
int partition(int* a, int p, int r) {
int x = a[p];
int i = p;
for(int j = p + 1; j < r; j++) {
if(a[j] <= x) {
i++;
@sortira
sortira / perm.c
Created November 20, 2025 05:06
stack queue perm
#include<stdio.h>
#define MAXSIZE 100
typedef struct {
int arr[MAXSIZE];
int top;
} stack;
typedef struct {
int front;
int rear;