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
package Notepad; | |
public class KMP { | |
static int[] getNext(String p){ | |
int i=1,j=0; | |
int[] next = new int[p.length()+2]; | |
char[] pattern = p.toCharArray(); | |
next[0] = -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
package Notepad; | |
import java.awt.*; | |
import javax.swing.*; | |
import java.awt.Toolkit; | |
public abstract class DFrame extends JFrame{ | |
/** |
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<iostream> | |
using namespace std; | |
int BS(int* arr, int n, int key){ | |
int low, high, mid; | |
low = 0; | |
high = n-1; | |
while(low<=high){ | |
mid = (low+high) >> 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
#include<iostream> | |
using namespace std; | |
int bs(int* a, int key, int low, int high){ | |
int mid; | |
mid = (low+high) / 2 ; | |
if(low>high){ | |
return -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
struct BinNode { | |
int data; | |
BinNode *lChild, *rChild; | |
}; | |
class BinSortTree{ | |
public: | |
BinSortTree(); | |
~BinSortTree(); | |
void SearchBST(int); | |
void CreateBST(int *, int); |
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
file1 = open("file1", "r") | |
file2 = open("file2", "r") | |
line1 = file1.readlines() | |
line2 = file2.readlines() | |
for i in range(0, len(line1)): | |
if(line1[i] != line2[i]): | |
print 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <iostream> | |
using namespace std; | |
typedef struct | |
{ | |
char type1; | |
char type2; | |
}BmpFileHead; |
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<iostream> | |
using namespace std; | |
int i=0; | |
bool chk(); | |
bool c(); | |
void main(){ | |
chk(); | |
} | |
bool chk(){ | |
i >=1000 || i++,cout << i << " "; |
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> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <iostream> | |
using namespace std; | |
typedef struct | |
{ | |
char type1; | |
char type2; | |
}BmpFileHead; |
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
#-*-coding: utf-8 -*- | |
EPS = 1.0e-4 | |
def guass(A, b): | |
""" 高斯消元法 | |
输入要求: | |
A = [[x11, x12, x13], [x21, x22, x23], [x31, x32, x33]] |
OlderNewer