This file contains hidden or 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
<?php | |
$num_rec_per_page=10; | |
mysql_connect('localhost','root',''); | |
mysql_select_db('apex1'); | |
if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; }; | |
$start_from = ($page-1) * $num_rec_per_page; | |
$sql = "SELECT * FROM student LIMIT $start_from, $num_rec_per_page"; | |
$rs_result = mysql_query ($sql); //run the query | |
?> | |
<table> |
This file contains hidden or 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
Algorithm MergeSort(arr, l, h) | |
{ | |
if(low < high) then | |
{ | |
mid := (low + high) / 2; | |
MergeSort(arr, low, mid); | |
MergeSort(arr, mid+1, high); | |
Merge(arr, low, mid, high); | |
} | |
} |
This file contains hidden or 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
int N, V[100], W[100], memo[100][100]; | |
int value(int id, int w) | |
{ | |
if (memo[id][w] != -1) return memo[id][w]; //Memoization | |
if (id == N || w == 0) return 0; //Base Case | |
else if (W[id] >w) return memo[id][w] = value(id + 1, w); | |
else return memo[id][w] = max(value(id + 1, w), V[id] + value(id + 1, w - W[id])); | |
} |
This file contains hidden or 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
int memo[100]; | |
int fibo(int n) | |
{ | |
if(n<=2) return 1; | |
else if(memo[n]!=-1) return memo[n]; | |
else return memo[n] = fibo(n-1) + fibo(n-2); | |
} |
This file contains hidden or 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
int fibo(int n) | |
{ | |
if(n<=2) return 1; | |
else return fibo(n-2) + fibo(n-1); | |
} |
This file contains hidden or 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> | |
#define pii pair<int,int> | |
#define infinity 99999999999 | |
using namespace std; | |
long long int n,m,u,v,w; | |
This file contains hidden or 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; | |
struct bst | |
{ | |
int data; | |
bst *left; | |
bst *right; | |
}*root=NULL; |
This file contains hidden or 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> | |
using namespace std; | |
struct node | |
{ | |
int data; | |
node *next; |
This file contains hidden or 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> | |
#include<stdlib.h> | |
using namespace std; | |
int front=0,rear=0; | |
void insertion(int queue[]) | |
{ | |
int num; | |
cout<<"\nEnter the item to be inserted : "; |
This file contains hidden or 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> | |
#include<stdio.h> | |
#include<string.h> | |
using namespace std; | |
int main() | |
{ | |
char s[50000]; | |
long i,l,p=0; | |
while(gets(s)) | |
{ |