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> | |
int Y[500][500]; | |
int B[500][500]; | |
int max(int a,int b){ | |
if(a>b) | |
return a; | |
return b; | |
} |
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> | |
using namespace std; | |
int f[100001],s[100001]; | |
int I[100001]; | |
int memo[100001]; | |
int fun(int i,int n){ | |
int ans = 0; | |
if(i>n) | |
return 0; | |
if(memo[i]!=-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
/*The structure of linked list is the following | |
struct node | |
{ | |
int data; | |
node* next; | |
};*/ | |
int detectloop(struct node *list){ | |
// your code goes here | |
if(list==0) | |
return 0; |
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
/* Linked List Node structure | |
struct Node { | |
int data; | |
Node *next; | |
} | |
*/ | |
// Should reverse list and return new head. | |
Node* fun(Node* head,Node* prev){ | |
if(head==0) |