Instantly share code, notes, and snippets.

💻
Building

# Rohit Roy Chowdhury roychowdhuryrohit-dev

💻
Building
Created December 21, 2020 09:59

### Keybase proof

I hereby claim:

• I am roychowdhuryrohit-dev on github.
• I am rychwdhryrohit (https://keybase.io/rychwdhryrohit) on keybase.
• I have a public key ASCf_H7-lVL1ZavligGxiaxtExSPstjw9QRetZS9r8_WDQo

To claim this, I am signing this object:

Created November 14, 2020 11:31
Find all values in a list that are present in the following sequence : f(0) = 0, f(1) = 1, f(n) = 5*f(n-1) - 2*f(n-2) for all n > 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
 from math import ceil, log, sqrt """ This solution uses the closed form expression of the given linear recurrence relation. Some approximations has been made to calculate the nearest value of n. Unlike other solutions that use recursion or memoization techniques, this is a much more faster and efficient constant time O(1) solution (assuming real-valued arithmetic is constant time). """ phi = 4.561552813 psi = 0.4384471872 sq = sqrt(17) def isPresent(k):
Created February 28, 2018 16:45
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 hashlib import sha256 import time from json import dumps # to define each blocks class Block: def __init__(self, data, prevHash=None): self.data = data
Created October 11, 2017 18:57
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 void sort(int pid[], int at[], int bt[], int n) { int temp, i, j, flag; for(i = 1;iat[j + 1]) { temp = pid[j]; pid[j] = pid[j + 1]; pid[j + 1] = temp;
Created September 5, 2017 20:00
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 #include typedef struct { int startTime, endTime, weight; } Job; struct S { // current job, last job. int cJob, lJob, weight; } *jobSeq; // Comparator function to be passed to qsort.
Last active August 22, 2017 16:47
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 #include #include #define X 99 // To reset the board and remove queens. void reset(int *board, int dim) { int i; for(i = 0;i
Last active April 18, 2023 15:32
Bank Management System as Java Console App
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 java.util.*; import java.text.*; interface SavingsAccount { final double rate = 0.04,limit = 10000,limit1 = 200; void deposit(double n,Date d); void withdraw(double n,Date d); } class Customer implements SavingsAccount {
Last active April 22, 2017 12:48
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
 /* * ----ROHIT ROY CHOWDHURY(Zeu5)---- */ #include #include typedef struct S { int data; struct S *l,*r; } node;