当前位置:首页 » 操作系统 » 算法设计课程设计

算法设计课程设计

发布时间: 2022-05-05 01:24:34

算法课程设计报告

题目中要求的功能进行叙述分析,并且设计解决此问题的数据存储结构,(有些题目已经指定了数据存储的,按照指定的设计),设计或叙述解决此问题的算法,描述算法建议使用流程图,进行算法分析指明关键语句的时间复杂度。
给出实现功能的一组或多组测试数据,程序调试后,将按照此测试数据进行测试的结果列出来 。
对有些题目提出算法改进方案,比较不同算法的优缺点。
如果程序不能正常运行,写出实现此算法中遇到的问题,和改进方法;
2 对每个题目要有相应的源程序(可以是一组源程序,即详细设计部分):
源程序要按照写程序的规则来编写。要结构清晰,重点函数的重点变量,重点功能部分要加上清晰的程序注释。
程序能够运行,要有基本的容错功能。尽量避免出现操作错误时出现死循环;
3 最后提供的主程序可以象一个应用系统一样有主窗口,通过主菜单和分级菜单调用课程设计中要求完成的各个功能模块,调用后可以返回到主菜单,继续选择其他功能进行其他功能的选择。最好有窗口展示部分。
4 课程设计报告:(保存在word 文档中,文件名要求 按照"姓名-学号-课程设计报告"起名,如文件名为"张三-001-课程设计报告".doc )按照课程设计的具体要求建立的功能模块,每个模块要求按照如下几个内容认真完成;
其中包括:
a)需求分析:
在该部分中叙述,每个模块的功能要求
b)概要设计
在此说明每个部分的算法设计说明(可以是描述算法的流程图),每个程序中使用的存储结构设计说明(如果指定存储结构请写出该存储结构的定义。
c)详细设计
各个算法实现的源程序,对每个题目要有相应的源程序(可以是一组源程序,每个功能模块采用不同的函数实现)
源程序要按照写程序的规则来编写。要结构清晰,重点函数的重点变量,重点功能部分要加上清晰的程序注释。
d)调试分析
测试数据,测试输出的结果,时间复杂度分析,和每个模块设计和调试时存在问题的思考(问题是哪些?问题如何解决?),算法的改进设想。
5. 课设总结: (保存在word 文档中)总结可以包括 : 课程设计 过程的收获、遇到问题、遇到问题解决问题过程的思考、程序调试能力的思考、对数据结构这门课程的思考、在课程设计过程中对C课程的认识等内容;
6.实验报告的首页请参考如下格式:

课程设计实验
起止日期:20 -20 学年 学期
系别 班级 学号 姓名
实验题目 □设计性 □综合性
自我评价
教师评语 能够实现实验要求的功能 □全部 □部分算法有新意 □有 □一般程序运行通过 □全部 □部分 算法注释说明 □完善 □仅有功能说明接口参数说明 □有 □无按期上交打印文档资料及源程序 □所有 □部分综合设计说明报告结构 □合理 □不合理用户使用说明 □完整 □不全现场演示操作有准备 □有 □无问题解答流畅 □流畅 □不流畅独立完成实验 □能 □不能体现团队合作精神。 □能够 □不能
成绩

这是张表格,过来时没调整好,不过应该看得明白。我们是这样写的,你可以参考一下。

⑵ 数据结构与算法课程设计求助

看上去有点象游戏引擎。
我最近也在研究这个。

不过,这是编译原理的范畴。

具体实现起来很复杂的,不过,可以给你一些大致的思路:

1、文本编辑器或者源代码读取程序(可以是用户输入或者从文件读入)
2、词法分析。(其实词法分析就是将各个元素比如变量、关键字、运算符等分离出来)
3、语法分析,语义分析。(其作用是生成语法树)
4、解释器,运行时环境。(维护程序运行时的环境,比如局部变量的建立、撤销;函数调用时环境的保存;堆、栈维护等。另外,还要提供固有命令(函数)的实现,就是说,用户调用了固有的命令时,将会发生什么。)

总的来说,很复杂的。这是一个很大的项目。别说200分,就是2000元,也很难找到。

推荐你看看编译原理(不过国内的编译原理的书籍,都只讲皮毛,要看就看英文的)另外,有一本《高级游戏脚本程序设计》不错。

再就是,你可以使用现成的语法分析生成器,比如:Lex+Yacc,不过需要修改生成的代码,才能在VC中使用。

⑶ 排序算法课程设计

// 各种排序算法汇总.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;

#include <stack>
#include <time.h>
#include <stdlib.h>

template < typename T >
class SqList
{
private:
int length;
T * r;
public://接口
SqList(int n = 0);//构造长度为n的数组
~SqList()
{
length = 0;
delete r;
r = NULL;
}
void InsertSort();//顺序插入排序
void DisPlay();//输出元素
void BInsertSort();//折半插入排序
void ShellSort(int dlta[],int t);//希尔排序
void QuickSort();//快速排序
void SelectSort();//简单选择排序
void BubbleSort();//改进冒泡排序
void Bubble_Sort2();//相邻两趟是反方向起泡的冒泡排序算法
void Bubble_Sort3();//对相邻两趟反方向算法进行化简,循环体中只包含一次冒泡
void HeapSort();//堆排序
void Build_Heap_Sort();//堆排序由小到大序号建立大根堆
void MergeSort();//归并排序
void OE_Sort();//奇偶交换排序的算法

void Q_Sort_NotRecurre();//非递归快速排序
void HeapSort_3();//三叉堆排序

public://调用
void ShellInsert(int dk);//一趟希尔排序
void QSort(int low,int high);//快速排序
int Partition(int low,int high);//一趟快速排序
int SelectMinKey(int i);//从i到length中选择最小值下标
void HeapAdjust(int s,int m);//调整s的位置,其中s+1~m有序
void HeapAdjust_3(int s,int m);//三叉堆****调整s的位置,其中s+1~m有序
void Merge(T SR[],T TR[],int i,int m,int n);//归并
void MSort(T SR[],T TR1[],int s,int t);//归并
void Easy_Sort(int low,int high);//3个数直接排序
void Build_Heap(int len);//从低下标到高下标逐个插入建堆的算法***建立大根堆**但为排序

};
template < typename T >
SqList<T>::SqList(int n = 0)
{
//srand( time(0) );
length = n;
r=new T[length+1];
T t;
cout<<"随机生成"<<n<<"个值:"<<endl;
for (int i=1;i<=length;i++)
{
//cin>>t;
r[i] = rand()%1000;
//r[i] = t;
}
for (int i=1; i<=length;i++)
cout<<r[i]<<",";
cout<<endl;
}
template < typename T >
void SqList<T>::InsertSort()
{
int i,j;
for (i=2;i<=length;i++)
{
if (r[i]<r[i-1])
{
r[0]=r[i];
r[i]=r[i-1];
for (j=i-2;r[0]<r[i-2];j--)
r[j+1]=r[j];
r[j+1]=r[0];
}
}
}
template < typename T >
void SqList<T>::DisPlay()
{
int i;
cout<<length<<" 元素为:"<<endl;
for (i = 1;i < length+1;i++ )
{
cout<<r[i]<<" ,";
}
cout<<endl;
}
template < typename T >
void SqList<T>::BInsertSort()
{
int i, j, m;
int low,high;
for (i = 2;i<= length;i++)
{
r[0]=r[i];
low=1;
high=i-1;
while (low<=high)
{
m = (low+high)/2;
if ( r[0] < r[m] )
high=m-1;
else
low=m+1;
}
for ( j=i-1;j >=high+1; j--)
{
r[j+1] = r[j];
}
r[high+1] = r[0];
}
}

template < typename T >
void SqList<T>::ShellInsert(int dk)
{
int i,j;
for (i=dk+1;i<=length;i++)
if (r[i] < r[i-dk])
{
r[0] = r[i];
for ( j=i-dk; j>0 && r[0] < r[j]; j-=dk)
{
r[j+dk]=r[j];
}
r[j+dk] = r[0];
}
}
template < typename T >
void SqList<T>::ShellSort(int dlta[],int t)
{
int k=0;
for (;k<t;k++)
{
ShellInsert(dlta[k]);
}
}
template < typename T >
int SqList<T>::Partition(int low,int high)
{
int pivotkey;
r[0] = r[low];//记录枢轴值
pivotkey = r[low];
while (low < high)
{
while (low < high&& r[high] >= pivotkey)
high--;
r[low] = r[high];
while (low < high&& r[low] <= pivotkey)
low++;
r[high] = r[low];
}
r[low] = r[0];//枢轴记录到位
return low;//返回枢轴位置
}
template < typename T >
void SqList<T>::QSort(int low,int high)
{
int pivotloc;
if (low < high)
{
pivotloc = Partition(low,high);
QSort(low,pivotloc-1);
QSort(pivotloc+1,high);
}
}
template < typename T >
void SqList<T>::QuickSort()
{
QSort(1,length);
}
template < typename T >
int SqList<T>::SelectMinKey(int i)
{
int j,min=i;
for (j=i;j <= length;j++)
{
if (r[min] > r[j])
{
min = j;
}
}
return min;
}
template < typename T >
void SqList<T>::SelectSort()
{
int i,j;
T t;
for (i=1;i < length;i++)//循环length-1次不是length次
{
j=SelectMinKey(i);
if (i != j)
{
t= r[j];
r[j]=r[i];
r[i]=t;
}
}
}
template < typename T >
void SqList<T>::BubbleSort()
{
int i,j;
int flag=1;//标识位,如果出现0,则没有交换,立即停止
T t;
for (i=1;i < length && flag;i++)
{
flag = 0;
for (j=length-1;j>=i;j--)
if (r[j]>r[j+1])
{
t=r[j];
r[j]=r[j+1];
r[j+1]=t;
flag=1;
}
}
}
template < typename T >
void SqList<T>::Bubble_Sort2()
{
bool change = true;
int low = 1, high = length;
int i;
T t;
while ( (low < high) && change )
{
change = false;
for ( i = low; i < high; i++ )
{
if ( r[i] > r[i+1] )
{
t = r[i];
r[i] = r[i+1];
r[i+1] = t;
change = true;
}
}
high-=1;
for ( i = high; i > low; i-- )
{
if ( r[i] < r[i-1] )
{
t = r[i];
r[i] = r[i-1];
r[i-1] = t;
change = true;
}
}
low+=1;
}
}

template < typename T >
void SqList<T>::Bubble_Sort3()
{
int i,d=1;
bool change = true;
int b[3] = {1,0,length};//b[0]为冒泡的下界,b[ 2 ]为上界,b[1]无用
T t;
while (change)//如果一趟无交换,则停止
{
change = false;
for ( i=b[1-d]; i!=b[1+d]; i=i+d )//统一的冒泡算法
{
if ( (r[i]-r[i+d])*d > 0 )///注意这个交换条件
{
t = r[i];
r[i] = r[i+d];
r[i+d] = t;
change = true;
}
}
d = d*(-1);//换个方向
}
}
template < typename T >
void SqList<T>::HeapAdjust(int s,int m)
{
/* 已知H.r[s..m]中记录的关键字除H.r[s].key之外均满足堆的定义,本函数 */
/* 调整H.r[s]的关键字,使H.r[s..m]成为一个大顶堆(对其中记录的关键字而言) */
int j;
T rc = r[s];
for (j=2*s;j <= m;j*=2)
{
/* 沿key较大的孩子结点向下筛选 */
if (j < m && r[j] < r[j+1])
j++;/* j为key较大的记录的下标 */
if (rc >= r[j])
break;/* rc应插入在位置s上 ,无需移动*/
r[s]=r[j];
s=j;
}
r[s]=rc;/* 插入 */
}
template < typename T >
void SqList<T>::HeapSort()
{
/* 对顺序表H进行堆排序。算法10.11 */
T t;
int i;
for (i=length/2;i>0;i--)/* 把H.r[1..H.length]建成大顶堆 */
HeapAdjust(i,length);
for (i=length;i>1;i--)
{
/* 将堆顶记录和当前未经排序子序列H.r[1..i]中最后一个记录相互交换 */
t=r[1];
r[1]=r[i];
r[i]=t;
HeapAdjust(1,i-1);/* 将H.r[1..i-1]重新调整为大顶堆 */
}
}
template < typename T >
void SqList<T>::Build_Heap_Sort()
{
int i;
Build_Heap(length);
for ( i = length; i > 1; i-- )
{
T t;
t = r[i];
r[i] = r[1];
r[1] = t;
Build_Heap(i-1);
}

}
template < typename T >
void SqList<T>::Build_Heap(int len)
{
T t;
for (int i=2; i <= len; i++ )
{
int j = i;
while ( j != 1 )
{
int k = j/2;
if ( r[j] > r[k] )
{
t = r[j];
r[j] = r[k];
r[k] = t;
}
j = k;
}
}

}
template < typename T >
void SqList<T>::Merge(T SR[],T TR[],int i,int m,int n)
{
/* 将有序的SR[i..m]和SR[m+1..n]归并为有序的TR[i..n] 算法10.12 */
int j,k,x;
for (j=m+1,k=i;j<=n&&i<=m;k++)/* 将SR中记录由小到大地并入TR */
{
if (SR[i]<SR[j])
TR[k]=SR[i++];
else
TR[k]=SR[j++];
}
if (i<=m)
for (x=0;x<=m-i;x++)
TR[k+x]=SR[i+x];/* 将剩余的SR[i..m]复制到TR */
if (j<=n)
for (x=0;x<=n-j;x++)
TR[k+x]=SR[j+x];/* 将剩余的SR[j..n]复制到TR */
}
template < typename T >
void SqList<T>::MSort(T SR[],T TR1[],int s,int t)
{
/* 将SR[s..t]归并排序为TR1[s..t]。算法10.13 */
int m;
T *TR2=new T[length+1];
if (s==t)
TR1[s]=SR[s];
else
{
m=(s+t)/2;/* 将SR[s..t]平分为SR[s..m]和SR[m+1..t] */
MSort(SR,TR2,s,m);/* 递归地将SR[s..m]归并为有序的TR2[s..m] */
MSort(SR,TR2,m+1,t);/* 递归地将SR[m+1..t]归并为有序的TR2[m+1..t] */
Merge(TR2,TR1,s,m,t);/* 将TR2[s..m]和TR2[m+1..t]归并到TR1[s..t] */
}
}
template < typename T >
void SqList<T>::MergeSort()
{
MSort(r,r,1,length);
}
template < typename T >
void SqList<T>::OE_Sort()
{
int i;
T t;
bool change = true;
while ( change )
{
change = false;
for ( i=1;i<length;i+=2 )
{
if (r[i] > r[i+1])
{
t = r[i];
r[i] = r[i+1];
r[i+1] = t;
change = true;
}
}
for ( i=2;i<length;i+=2 )
{
if ( r[i] > r[i+1] )
{
t = r[i];
r[i] = r[i+1];
r[i+1] = t;
change = true;
}
}

}

}
typedef struct
{
int low;
int high;
}boundary;
template <typename T >
void SqList<T>::Q_Sort_NotRecurre()
{
int low=1,high=length;
int piv;
boundary bo1,bo2;
stack<boundary> st;
while (low < high)
{
piv = Partition(low,high);
if ( (piv-low < high-piv) && (high-piv > 2) )
{
bo1.low = piv+1;
bo1.high = high;
st.push(bo1);
high = piv-1;
}
else if ( (piv-low > high-piv) && (piv-low >2) )
{
bo1.low = low;
bo1.high = piv-1;
st.push(bo1);
low = piv+1;
}
else
{
Easy_Sort(low,high);
high = low;
}
}
while ( !st.empty() )
{
bo2 = st.top();
st.pop();
low = bo2.low;
high = bo2.high;
piv = Partition(low, high);
if ( (piv-low < high-piv) && (high-piv > 2) )
{
bo1.low = piv+1;
bo1.high = high;
st.push(bo1);
high = piv-1;
}
else if ( (piv-low > high-piv) && (piv-low >2) )
{
bo1.low = low;
bo1.high = piv-1;
st.push(bo1);
low = piv+1;
}
else
{
Easy_Sort(low,high);
}
}

}
template < typename T >
void SqList<T>::Easy_Sort(int low,int high)
{
T t;
if ( (high-low) == 1 )
{
if ( r[low] > r[high] )
{
t = r[low];
r[low] = r[high];
r[high] = t;
}
}
else
{
if ( r[low] > r[low+1] )
{
t = r[low];
r[low] = r[low+1];
r[low+1] = t;
}
if ( r[low+1] > r[high] )
{
t = r[low+1];
r[low+1] = r[high];
r[high] = t;
}
if ( r[low] > r[low+1] )
{
t = r[low];
r[low] = r[low+1];
r[low+1] = t;
}
}

}

template < typename T >
void SqList<T>::HeapAdjust_3(int s,int m)
{
T rc = r[s];
for (int j = 3*s-1; j <= m;j=j*3-1)
{
if (j+1<m)//有3个孩子结点
{
if ( rc>=r[j] && rc>=r[j+1] && rc>=r[j+2] )
break;
else
{
if ( r[j] > r[j+1] )
{
if ( r[j] > r[j+2] )
{
r[s]=r[j];
s=j;
}
else//r[j]<=r[j+2]
{
r[s]=r[j+2];
s=j+2;
}
}
else//r[j]<=r[j+1]
{
if ( r[j+1] > r[j+2] )
{
r[s]=r[j+1];
s=j+1;
}
else//r[j+1]<=r[j+2]
{
r[s]=r[j+2];
s=j+2;
}
}
}
}
if ( j+1==m )//有2个孩子结点
{
if ( rc>=r[j] && rc>=r[j+1] )
break;
else
{
if ( r[j] > r[j+1] )
{
r[s]=r[j];
s=j;
}
else//r[j]<=r[j+1]
{
r[s]=r[j+1];
s=j+1;
}
}
}
if (j==m)//有1个孩子结点
{
if ( rc>=r[j] )
break;
else
{
r[s]=r[j];
s=j;
}
}
}
r[s]=rc;
}

template <typename T >
void SqList<T>::HeapSort_3()
{
int i;
T t;
for (i=length/3; i>0; i--)
HeapAdjust_3(i,length);
for ( i=length; i > 1; i-- )
{
t = r[i];
r[i] = r[1];
r[1] = t;
HeapAdjust_3(1,i-1);
}
}

int _tmain(int argc, _TCHAR* argv[])
{
SqList<int> Sq(15);
//Sq.InsertSort();
//Sq.BInsertSort();
/* 希尔排序*/
// int a[5]={5,4,3,2,1};
// Sq.ShellSort(a,5);

/* Sq.QuickSort();*/

// Sq.SelectSort();

/* Sq.BubbleSort();*/

/* Sq.HeapSort();*/

/* Sq.MergeSort();*/

/* Sq.Q_Sort_NotRecurre();*/

/* Sq.Bubble_Sort2();*/
/* Sq.OE_Sort();*/
/* Sq.Bubble_Sort3();*/

/* Sq.Build_Heap_Sort();*/

Sq.HeapSort_3();

Sq.DisPlay();
system("pause");
return 1;
}

⑷ 实时调度算法的课程设计 要用c语言

#include<stdio.h>
int main()
{
int A,B; //标记进程A,进程B的到达时间
int cycA,cycB,serveA,serveB; //进程的周期时间和服务时间
float m;
int i,j,a=0,b=0,ka=0,kb=0; //ka,kb为开关,i,j,a,b为进程下标
int numa=0,numb=0; //服务累计时间
printf("输入进程A的周期时间,服务时间:");
scanf("%d%d",&cycA,&serveA);
printf("输入进程B的周期时间,服务时间:");
scanf("%d%d",&cycB,&serveB);
m=(float)serveA/cycA+(float)serveB/cycB;
for(int T=0;T<=100;T++)
{
if(m-1>1e-6)
{
printf("超出CPU的处理能力!\n");
return 0;
}
if(numa==serveA) //进程A完成
{
numa=serveA+1;
printf("当T=%d时",T);
printf("进程A%d结束\n",a);
if(numb<serveB)
{
printf(" 调用进程b%d\n",b);
kb=1;
}
ka=0;
}
if(numb==serveB)
{
numb=serveB+1;
printf("当T=%d时",T);
printf("进程B%d结束\n",b);
if(numa<serveA)
{
printf(" 调用进程A%d\n",a);
ka=1;
}
kb=0;
}
if(T%cycA==0 && T%cycB==0)
{
A=B=T;
j=++a;
i=++b;
printf("当T=%d时,进程A%d和进程B%d同时产生,此时,",T,j,i);
if(cycA<=cycB)
{
printf("调用进程A%d,阻塞进程B%d\n",j,i);
ka=1;
kb=0;
}
else
{
printf("调用进程B%d,阻塞进程A%d\n",i,j);
ka=0;
kb=1;
}
numa=numb=0;
}
if(T%cycA==0&&T%cycB!=0)
{
A=T;
printf("当T=%d时",T);
printf("进程A%d产生 ",++a); //不可能与进程A竞争处理器
numa=0;
if(numb<serveB) //进程B没有完成
if(B+cycB>A+cycA) //若进程B最早截止时间大于进程A的
{
printf("进程A%d执行。\n",a);
ka=1;
kb=0;
}
else //若进程B最早截止时间小于等于进程A的
printf("进程B%d继续执行。\n",b);
else //进程B完成
{
printf("进程A%d执行。\n",a);
ka=1;
}
}
if(T%cycA!=0&&T%cycB==0)
{
B=T;
printf("当T=%d时",T);
printf("进程B%d产生,",++b); //不可能与进程B竞争处理器
numb=0;
if(numa<serveA) //进程A没有完成
if(B+cycB>=A+cycA) //进程A的最早截止时间不小于B
printf("进程A%d继续执行。\n",a);
else
{
printf("进程B%d执行。\n",b);
kb=1;
ka=0;
}
else //进程A完成
{
printf("进程B%d执行。\n",b);
kb=1;
}
}
if(ka)
numa++;
if(kb)
numb++;
}
}

⑸ 数据结构与算法课程设计——集合运算

#include<stdio.h>
#include<malloc.h>
#include<stdlib.h>
struct set{
int coef;
struct set *next;
};

void createlist_p(struct set *&p,int n)
{
int i;
struct set *L;
p=(struct set *)malloc(sizeof(set));
p->next=NULL;
for(i=n;i>0;i--)
{
L=(struct set *)malloc(sizeof(set));
printf("请输入该集合中第%d个整数元素:",n-i+1);
scanf("%d",&L->coef);
L->next=p->next;
p->next=L;
}
}//生成新链表用于存放两集合中的元素
void printlist_p(struct set *&p)
{
struct set *L;
int i;
L=p->next;
if(!L) printf("该表为空!\n");
while(L!=NULL)
{
printf("%d ",L->coef);
L=L->next;
i++;
}
printf("\n");
}//打印输入的两集合中的元素
void Addset(struct set *&p,struct set *&q,struct set *&r)
{
struct set *k,*m,*n;
r=(struct set *)malloc(sizeof(set));
r->next=NULL;
k=p->next;
for(;k;)
{
m=(struct set *)malloc(sizeof(set));
m->next=r->next;
r->next=m;
m->coef=k->coef;
k=k->next;
}//把第一个集合中的元素放在新集合中
k=q->next;
m=(struct set *)malloc(sizeof(set));
m->next=r->next;
r->next=m;
m->coef=k->coef;
k=k->next;
for(;k;)
{
for(n=r->next;(k->coef!=n->coef)&&n->next;){
n=n->next;
}//与新集合中的元素比较
if((k->coef!=n->coef)&&!(n->next)){
m=(struct set *)malloc(sizeof(set));
m->next=r->next;
r->next=m;
m->coef=k->coef;
}
k=k->next;
}//对第二个集合中的元素进行分析

}//求A∪B
void Subset(struct set *&p,struct set *&q,struct set *&r){
struct set *k,*m,*n;
r=(struct set *)malloc(sizeof(set));
r->next=NULL;
n=q->next;
for(;n;){
m=p->next;
for(;(m->coef!=n->coef)&&m->next;){
m=m->next;
}
if(m->coef==n->coef) {
k=(struct set *)malloc(sizeof(set));
k->next=r->next;
r->next=k;
k->coef=m->coef;
}
n=n->next;
}

}//求A∩B
void Intset(struct set *&p,struct set *&q,struct set *&r){
struct set *k,*m,*n;
r=(struct set *)malloc(sizeof(set));
r->next=NULL;
m=p->next;
for(;m;){
n=q->next;
for(;(m->coef!=n->coef)&&n->next;){
n=n->next;
}
if(!n->next&&(m->coef!=n->coef)) {
k=(struct set *)malloc(sizeof(set));
k->next=r->next;
r->next=k;
k->coef=m->coef;
}
m=m->next;
}
}//求A-B
void bangzhu(){
printf("\n\t\t\t***********************************");
printf("\n\t\t\t* 求集合的交并差 *");
printf("\n\t\t\t*********************************\n");
}
void main()
{
struct set *p,*q,*r;
int m,n,node;
bangzhu();

for(;;)
{
do{
printf("请输入您要选择操作的代码:\n");
printf("1:求两集合的并A∪B\n");
printf("2:求两集合的交A∩B\n");
printf("3:求两集合的差A-B\n");
printf("0:退出该程序\n");
scanf("%d",&node);
} while(node<0||node>3);

if(node==0) exit(1);
printf("\t\t\t/*请输入集合A中元素的个数:*/\n");
scanf("%d",&m);
createlist_p(p,m);
printf("\t\t\t/*请输入集合B中元素的个数:*/\n");
scanf("%d",&n);
createlist_p(q,n);
printf("集合A中元素为:");
printlist_p(p);
printf("集合B中元素为:");
printlist_p(q);
while(node<0||node>3);
switch(node)
{
case 1: Addset( p,q,r);printf("A∪B:\n");printlist_p(r);break;
case 2: Subset( p,q,r);printf("A∩B:\n");printlist_p(r);break;
case 3: Intset(p,q,r); printf("A-B:\n");printlist_p(r);break;
}
printf("\n");
}
}
可以了
楼上方法是正确的,学习!把分给楼上

⑹ 计算方法与程序设计学什么的

计算机科学与技术专业培养和造就适应会主义现代化建设需要,德智体全面发展、基础扎实、知识面宽、能力强、素质高具有创新精神,系统掌握计算机硬件、软件的基本理论与应用基本技能,具有较强的实践能力,能在企事业单位、政府机关、行政管理部门从事计算机技术研究和应用,硬件、软件和网络技术的开发,计算机管理和维护的应用型专门技术人才。
本专业学生主要学习计算机科学与技术方面的基本理论和基本知识,接受从事研究与应用计算机的基本训练,具有研究和开发计算机系统的基本能力。
本科毕业生应获得以下几方面的知识和能力:
1.掌握计算机科学与技术的基本理论、基本知识;
2.掌握计算机系统的分析和设计的基本方法;
3.具有研究开发计算机软、硬件的基本能力;
4.了解与计算机有关的法规;
5.了解计算机科学与技术的发展动态;
6.掌握文献检索、资料查询的基本方法,具有获取信息的能力。
主要课程:电路原理、模拟电子技术、数字逻辑、数值分析、计算机原理、微型计算机技术、计算机系统结构、计算机网络、高级语言、汇编语言、数据结构、操作系统、数据库原理、编译原理、图形学、人工智能、计算方法、离散数学、概率统计、线性代数以及算法设计与分析、人机交互、面向对象方法、计算机英语等。
主要实践性教学环节:包括电子工艺实习、硬件部件设计及调试、计算机基础训练、课程设计、计算机工程实践、生产实习、毕业设计(论文)。

热点内容
什么配置可以算神机 发布:2024-10-06 21:52:09 浏览:421
两条吊筋怎么配置高度 发布:2024-10-06 21:46:22 浏览:490
安卓平板b站缓存文件位置 发布:2024-10-06 21:44:43 浏览:906
能缓存视频的播放器 发布:2024-10-06 21:36:48 浏览:132
安卓接入点哪个好 发布:2024-10-06 21:25:01 浏览:450
ns服务器怎么搭建 发布:2024-10-06 20:56:22 浏览:806
自解压功能 发布:2024-10-06 20:51:40 浏览:590
win7限制上传速度 发布:2024-10-06 20:42:58 浏览:541
php判断字符串是否空 发布:2024-10-06 20:42:48 浏览:116
行业均衡配置基金有哪些 发布:2024-10-06 20:42:11 浏览:194