2024年11月软件设计师案例题

一、交通系统

1、完善A1-A4  U1-U4

2、完善c1-c2

3、根据强度去分配给适合他的人,

二、数码相机

1、相机的10个部件:镜头、拍照按钮、手动调焦、对焦开关、模式切换(视频、图片)、相机正面屏幕、光传感器、闪关灯、xx传感器(忘记了)、pc连接线

2、两个存储    视频和图片

3、数据流组成:闪光强度、数据、还有一个

3、结构化开发方法步骤

三、货物运输系统

货物(货物名称,编号)

托运(日期,货物编号,班列编号)

班列(班列,日期)

客户(手机号,名称)

1、完善图关联关系

2、完善托运关键字

3、增加一个签证实体,写出关联关系

四、算法题搜索二叉树   (根下面的类似)

#include <stdio.h>
#include <stdlib.h>
 
// 定义二叉树节点结构体
typedef struct node {
    int data;
    struct node *left;
    struct node *right;
} Node;
 
// 函数声明
Node* insert(Node* root, int data);
Node* search(Node* root, int data);
 
int main() {
    Node* root = NULL; // 初始化根节点为NULL
 
    // 插入节点
    root = insert(root, 10);
    root = insert(root, 20);
    root = insert(root, 30);
    root = insert(root, 40);
    root = insert(root, 50);
 
    // 搜索节点
    Node* found = search(root, 30);
    if (found) {
        printf("找到节点,其数据为 %d\n", found->data);
    } else {
        printf("未找到节点\n");
    }
 
    return 0;
}
 
// 插入节点函数
Node* insert(Node* root, int data) {
    if (root == NULL) { // 如果根节点为空,创建新节点并返回
        Node* newNode = (Node*)malloc(sizeof(Node));
        newNode->data = data;
        newNode->left = newNode->right = NULL;
        return newNode;
    }
 
    if (data < root->data) { // 插入到左子树
        root->left = insert(root->left, data);
    } else if (data > root->data) { // 插入到右子树
        root->right = insert(root->right, data);
    }
 
    return root; // 返回更新后的根节点
}
 
// 搜索节点函数
Node* search(Node* root, int data) {
    if (root == NULL || root->data == data) {
        return root;
    }
 
    if (data < root->data) {
        return search(root->left, data);
    } else {
        return search(root->right, data);
    }
}

        1、完善1-5空

        2、节点为n的二叉树 ,高度最大是多少

        3、给了一个序列,按搜索二叉树排序

五、java组合模式(与下面类似)

abstract class Component {

        protected String name;
        public abstract void show();

        public  abstract void draw(int dx,int dy);
}
 
class Circle implements Component {

    public Circle(String name) {
        this.name = name;
    }
 
    public void  draw(int dx,int dy) {
        System.out.println("Circle " + dx+ "----"+dy);
    }
    public void  show() {
        System.out.println("Circle " + name + " operation.");
    }
}
 
class Composite implements Component {
    private List<Component> children ;
    public Composite(String name) {
        this.name = name;

        this.children = new ArrayList<Component>()
    }
 
   -------------

        略

   -------------
}
 
public class CompositePatternExample {
    public static void main(String[] args) {
        Composite root = new Composite("Circle");    //这里字符串随便写
        root.add(new Circle ("circle1"));
        root.add(new Circle ("circle1"));
  

   -------------

        略

   -------------

    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值