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> | |
| using namespace std; | |
| class test | |
| { | |
| public: | |
| static int f; | |
| int x; | |
| test() | |
| { | |
| f+=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 <stdio.h> | |
| double f(double x) | |
| { | |
| return (x*x*x - 2*x -5); | |
| } | |
| int main() | |
| { | |
| int i; | |
| // By regula falsi |
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> | |
| double f(double x,double y) | |
| { | |
| return (x+y); | |
| } | |
| int main() | |
| { | |
| double x0=0; | |
| double y0=1; | |
| double h=0.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 <stdio.h> | |
| # include <math.h> | |
| double f(double x) | |
| { | |
| return ( exp(x*x) ); | |
| } | |
| int main() | |
| { | |
| double l1=0; |
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> | |
| double f(double x,double y) | |
| { | |
| return (x+y); | |
| } | |
| int main() | |
| { | |
| double h=0.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
| # include <stdio.h> | |
| int add(int a[][10],int b[][10],int n,int m,int r[10][10]) | |
| { | |
| int i,j; | |
| for(i=0;i<n;i++) | |
| { | |
| for(j=0;j<m;j++) | |
| { | |
| r[i][j]= a[i][j] + b[i][j]; |
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
| graph = {'A': set(['B', 'C']), | |
| 'B': set(['A', 'D', 'E']), | |
| 'C': set(['A', 'F']), | |
| 'D': set(['B']), | |
| 'E': set(['B', 'F']), | |
| 'F': set(['C', 'E'])} | |
| def dfs (graph,start,visited=None): | |
| if visited is None: | |
| visited=set() |
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
| graph = { 'A':set(['B', 'C']), | |
| 'B': set(['A', 'D', 'E']), | |
| 'C': set(['A', 'F']), | |
| 'D': set(['B']), | |
| 'E': set(['B', 'F']), | |
| 'F': set(['C', 'E'])} | |
| s= 'A' | |
| visited = set() | |
| stack = [s] |
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
| graph = {'0': set(['1', '2']), | |
| '1': set(['2']), | |
| '2': set(['0', '3']), | |
| '3': set(['3'])} | |
| visited = {} | |
| for each in graph: | |
| visited [each]=False | |
| queue = [] |
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
| class Node: | |
| def __init___(self,data=0,next=None): | |
| self.data = data | |
| self.next = next | |
| class LinkedList: | |
| def __init__(self): |