Skip to content

Instantly share code, notes, and snippets.

View djassie's full-sized avatar

Susobhan Das djassie

View GitHub Profile
@djassie
djassie / binary_search.c
Created March 30, 2024 00:33
Binary Search : number of negatives in sorted matrix in C
int rowNegatives(int *arr, int size){
int li = 0, ri = size - 1, negative=0;
//corner cases
if(*(arr+size-1) >=0){return 0;}
if(*arr<0){return size;}
while(li<=ri){
int mid = li + (ri - li)/2;
if(*(arr+mid)<0 && *(arr+mid-1)>=0){
return size - mid;
@djassie
djassie / depth-first-search.c
Created March 18, 2024 12:15
Depth First search in C C++/Java Style
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct node node;
struct node {
int data;
node *next;
};
@djassie
djassie / drupal_hackedgit.md
Created December 25, 2021 16:57 — forked from derhasi/drupal_hackedgit.md
Script to get a diff of a Drupal dev project from git and write the diff to the projects folder: `bash check_hacked.sh $PROJECTNAME`.

Check hacked status from git

This small script provides some code to check a project of your installation (located in .../www) against the associated git commit on drupal.org.

Notice: currently the root path and temp directory are hardcoded.

Examples

Check status of views module.