122 - Trees on the level

本文详细介绍了如何学习算法与数据结构,并通过实例代码展示了实际应用。文章包含输入读取、树节点创建、删除、添加操作及广度优先搜索算法实现。

学到很多,虽然还不能完全领悟,不过以后在做题中再慢慢消化吧~

#include<cstdio>

#include<cstring>
#include<vector>
#include<queue>
#include<iostream>
using namespace std;
const int maxn = 300;
bool failed;
char s[maxn];
struct Node {
    bool have_value;
    int v;
    Node *left,*right;
    Node():have_value(false),left(NULL),right(NULL) {}
};
Node *root;
Node*newnode() { return new Node(); }
void remove_tree(Node*u) {
    if(u==NULL) return ;
    remove_tree(u->left);
    remove_tree(u->right);
    delete u;
}
void addnode(int v,char *s){
    int n=strlen(s);
    Node*u=root;
    for(int i=0;i<n;i++)
    if(s[i]=='L'){
        if(u->left==NULL) u->left=newnode();
        u=u->left;
    } else if(s[i]=='R'){
        if(u->right==NULL) u->right=newnode();
        u=u->right;
    }
    if(u->have_value) failed=true;
    u->v=v;
    u->have_value=true;
}
bool read_input(){
    failed =false;
    remove_tree(root);
    root = newnode();
    for(;;) {
        if(!(cin>>s)) return false;
        if(!strcmp(s,"()")) break;
        int v;
        sscanf(&s[1],"%d", &v);
        addnode(v,strchr(s,',')+1);
    }
    return true;
}
bool bfs(vector<int>&ans){
    queue<Node*> q;
    ans.clear();
    q.push(root);
    while(!q.empty()){
        Node*u=q.front(); q.pop();
        if(!u->have_value) return false;
        ans.push_back(u->v);
        if(u->left!=NULL) q.push(u->left);
        if(u->right!=NULL) q.push(u->right);
    }
    return true;
}
vector<int > bbs;
int main(){
    while(1){
        if(!read_input()) break;
        int kase=0;
        if(bfs(bbs)&&!failed){
            vector<int>::iterator it;
            for(it=bbs.begin();it!=bbs.end();it++){
                if(kase) cout<<" "<<*it;
                else cout<<*it;  kase=1;
            } printf("\n");
        }else printf("not complete\n");
    }
    return 0;
}
翻译:and a material design model, for simulating the characteristics of the semiconductor equipment. Mitrovic and Strang [19] applied the first-principle simulation to virtual sensor measurements to facilitate the process performed by the semiconductor processing tool. However, semiconductor manufacturing consists of hundreds of processing phases, months of processing time and correlative process flows [20]. The corresponding behavior analysis of the tool failure degradation process is very limited. Thus, the results provide neither reliable and accurate physical or mathematical models nor confident experience feedback for mechanism-based modeling. This is the main limitation of the applications of model-based approaches. In the knowledge-based methods, competitive advantages for stabilizing maintenance processes and reducing unplanned costs are realized by holistic consideration of production processes [21]. Prescriptive maintenance is known as the highest maturity and complexity level of knowledge-based maintenance [22], and “how can we control the occurrence of a specific event” should be answered and useful advice for decision-making to be given to improve and optimize the upcoming maintenance processes [23]. Nemeth et al. [22] built on the concept of prescriptive maintenance and proposed a reference model called PriMa-X to support the implementation of a prescriptive maintenance strategy and the assessment of its maturity level, facilitating the integration of data driven methods for predicting future events and identify action fields to reach an enhanced target maturity state. Padovano et al. [24] proposed a framework to construct the missing link between prescriptive maintenance and production planning and control functions in a cyber–physical production environment. Shaheen and Németh [25], Silvestri et al. [26], and Zonta et al. [27] discussed the prescriptive maintenance methods for Industry 4.0 technologies. Obtaining domain knowledge and converting it to precise rules are usually difficult as they require strong background and experience. Besides, the new situations without being covered by the knowledge bases cannot be handled. Data-driven methods are effective when acquiring practical data is more convenient than establishing physical or analytical models [28]. With the development of sensor techniques and wide applications of advanced process control technologies [29], the numerous manufacturing data provide wide opportunities for applying the data-driven prognostics methods to deal with the failure time prediction in the semiconductor manufacturing. Based on the monitoring data, the system degradation tendency can be easily understood and predicted. Generally, data-driven methods applied to the prognostics in the industry are adapted from the ones used in machine learning [29], [30]: neural networks [10], [31], k-nearest neighbor [32], [33], statistical methods [11], [34], decision trees [35], [36], clustering analysis [37], [38], and so on. Regarding the prognostics in semiconductor manufacturing, Bouaziz et al. [40] addressed a predictive approach based on the Bayesian network to analyze the device health factor. It allows early scheduling for preventive maintenance and avoids unscheduled tool downtime. Jia et al. [41] developed an adaptive method on the basis of the polynomial neural network to infer the material removal rate in the chemical-mechanical planarization process of the semiconductor fabrication. Yang and Lee [42] applied the Bayesian belief network to analyze the causal relationship of the process variables and estimate their effects on wafer quality to achieve high-classification rates for wafer quality and identify the problematic sensors when any bad wafer is detected. In reality, the quantity and quality of the data collected from the processes are problematic when it comes to developing and maintaining effective data-driven prognostics models [43]. As the failure can be slowly accumulated, the relevant data for evaluating the failure behavior would be scarce. In addition, most data-driven prognostics methods in semiconductor manufacturing focus on the deterministic estimation without giving the confidence level of the inference of the tool failure prognostics, which implies how much effect on the accuracy of the prognostic models built upon the acquired data is unknown. Using the poorly monitoring data would result in an improper estimation of the cleaning time. For more accurate prognostics, it is necessary to have a good and reliable prognostic model. As the tool failure mechanisms and uncertainty in semiconductor manufacturing are complex and unavailable, this article proposes a data-driven prognostic method to study the failure behavior and predict the tendency on the basis of the obtained production data in the fabrication process. One of the achievements is implementing the prognostics for determining the explicit cleaning time and reducing the dependence on the mechanism analysis. A novel failure factor extraction and prognostic model is developed based on autoassociative regression (AR)-Gaussian process (GP), which is the integration of the AR [44] and the GP [45]. It can be used to analyze and extract the failure factors by the comparisons between the actual data and the fault-free data. Furthermore, with the analysis of the residual tendency, the abnormalities can be detected to be used as the variables of the prognostic model. To infer the future failure behaviors in the fabrication process of semiconductor manufacturing, the data-driven prognostic model is constructed on the basis of GP to present the degradation evolution in a probability distribution and evaluate the uncertainty. Thanks to the confident interval of each estimated value, the accuracy of the prediction influenced by the collected data quality can be presented. It cannot be done by the deterministic estimation. And the suitable cleaning time for the fabrication process is given based on the discussion of the possible failure phenomena in semiconductor manufacturing. This article is structured as follows. The prognostic problem in semiconductor manufacturing is defined and its issues are discussed in Section II. Section III details the novel AR-GP method. The feasibility and the promising results of the ARGP method are validated through a numerical example and a practical semiconductor manufacturing process for the failure factor extraction and failure behavior inference, respectively, in Section IV. Finally, Section V draws conclusions.
11-24
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值