代码搜索:查表法
找到约 10,000 项符合「查表法」的源代码
代码结果 10,000
www.eeworm.com/read/269229/11104873
h tree.h
//树的孩子兄弟表示法为存储结构的结构体Tree.h
template class Tree;
template struct TreeNode
{friend class Tree;//树类为友元
private:
TreeNode *firstChild;//第一个孩子结点指针域
TreeNode *nextSibli
www.eeworm.com/read/269229/11105187
cpp erfenfa1.cpp
//二分查找法(递归调用)erfenfa1.cpp
#include
#include
#include
double a[10]={1.1,1.3,1.5,1.7,1.9,2.1,2.3,2.5,2.7,2.9};
void binsrch(int s,int r,double x)
{int m;
m=(s+r)
www.eeworm.com/read/268719/11124590
cpp newton.cpp
float f(float x[],float y[],int s,int t)//牛顿插值法,用以返回差商
{
if(t==s+1)
return (y[t]-y[s])/(x[t]-x[s]);
else
return (f(x,y,s+1,t)-f(x,y,s,t-1))/(x[t]-x[s]);
}
www.eeworm.com/read/268481/11136820
h 10_4.h
#ifndef SEARCH_METHODS
#define SEARCH_METHODS
//用顺序查找法在数组list中查找值为key的元素
//若找到,返回该元素下标,否则返回-1
template
int SeqSearch(T list[], int n, T key)
{
for(int i=0;i < n;i++)
if (l
www.eeworm.com/read/268467/11137233
cpp package.cpp
#include
#define N 6
int main(){
//从N个背包(每个背包中w[k])中选取总重为T的背包,共有多少种选法
int w[N]={1,8,3,4,5,2}; //6个背包
int T=10; //总重
int k=0
www.eeworm.com/read/247721/12626341
m funfminu.m
options(6)=1;%拟牛顿法的DFP公式
options(7)=0;%混合的二次型和三次型插值
[x,options]=fminu('funrosen',[-1.2,2],options)
y=options(8) %输出在最后极值点的函数值
n=options(10)%给出函数计算次数
www.eeworm.com/read/247654/12637522
m funfminu.m
options(6)=1;%拟牛顿法的DFP公式
options(7)=0;%混合的二次型和三次型插值
[x,options]=fminu('funrosen',[-1.2,2],options)
y=options(8) %输出在最后极值点的函数值
n=options(10)%给出函数计算次数
www.eeworm.com/read/247651/12637923
m gauss.m
%顺序gauss消去法,gauss函数
function [A,u]=gauss(a,n)
for k=1:n-1
%消去过程
for i=k+1:n
for j=k+1:n+1
%如果a(k,k)=0,则不能消去
if abs(a(k,k))>1e-6
%计算第k步的增广矩阵
www.eeworm.com/read/247611/12639085
m funfminu.m
options(6)=1;%拟牛顿法的DFP公式
options(7)=0;%混合的二次型和三次型插值
[x,options]=fminu('funrosen',[-1.2,2],options)
y=options(8) %输出在最后极值点的函数值
n=options(10)%给出函数计算次数
www.eeworm.com/read/237997/13913566
c dfs.c
/* file name: dfs.c */
/*图的遍历一邻接表与深度优先搜索法(DFS)*/
#include
#include
#include
#define MAX_V 100 /*最大节点数*/
#define TRUE 1
#define FALSE 0
/*定义数据结构*/
typedef