网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
如果设treeView1=new TreeView(),TreeNode node=new TreeNode("根结点"),则treeView1.Nodes.Add(node)返回的是一个类型的值。()
A

TreeNode;

B

int;

C

string;

D

TreeView;


参考答案

参考解析
解析: 暂无解析
更多 “单选题如果设treeView1=new TreeView(),TreeNode node=new TreeNode("根结点"),则treeView1.Nodes.Add(node)返回的是一个类型的值。()A TreeNode;B int;C string;D TreeView;” 相关考题
考题 设计递归算法,判断二叉树t是否满足小根堆的特点。二叉链表的类型定义如下: typedef int datatype;//结点的数据类型,假设为inttypedef struct NODE *pointer;//结点指针类型struct NODE {datatype data;pointer lchild,rchild;};typedef pointer bitree;//根指针类型

考题 阅读以下说明、图和C代码。【说明】一般的树结构常采用孩子-兄弟表示法表示,即用二叉链表作树的存储结构,链表中结点的两个链域分别指向该结点的第一个孩子结点和下一个兄弟结点。例如,图10-8(a)所示的树的孩子-兄弟表示如图10-8(b)所示。函数LevelTraverse()的功能是对给定树进行层序遍历。例如,对图10-1所示的树进行层序遍历时,结点的访问次序为D B A E F P C。对树进行层序遍历时使用了队列结构,实现队列基本操作的函数原型如下表所示:Bool、Status类型定义如下:typedef enum { FALSE=0,TRUE=1 } Bool;typedef enum { VERFLOW=-2,UNDERFLOW=-1,ERROR=0,OK=1}Status;树的二叉链表结点定义如下:typedef struct Node {char data;struct Node *firstchild,*nextbrother;} Node,*TreeNode;【函数】Status LevelTraverse ( TreeNode root ){ /*层序遍历树,树采用孩子-兄弟表示法,root是树根结点的指针*/Queue tempQ;TreeNode ptr,brotherptr;if (! root)return ERROR;InitQueue(tempQ);(1);brotherptr = root -> nextbrother;while (brotherptr) {EnQueue(tempQ,brotherptr);(2);}/*end-while*/while((3)){(4);printf("%c\t",ptr->data);if((5))continue;(6);brotherptr = ptr->firstchild->nextbrother;while (brotherptr) {EnQueue(tempQ,brotherptr);(7);}/*end-while*/}/*end-while*/return OK;}/*LevelTraverse*/

考题 Simplify the following Boolean expression!((i ==12) || (j 15))struct Node {int value;Node* next;};1.1 Get the value of the Nth node from last node in the linked list.PARAM HEAD: the first element in the linked list:PARAM n: the number of the node counted reverselyRETURN: the value of the node, or -1 if not existsint GetValue(Node* HEAD, int n){}1.2 Delete a node WITHOUT using the HEAD pointer.PARAM p: A pointer pointed to a node in the middle of the linked list.RETURN: voidvoid Delete(Node* p){}1.3 Insert a new node before p WITHOUT using the HEAD pointerPARAM p: A pointer pointed to a node in the middle of the linked list.PARAM value: new Node valueRETURN: voidvoid Insert(Node* p, int value){}Question 2:Please write a String class with following features:

考题 阅读以下说明和C++程序,将应填入(n)处的字句写在对应栏内。【说明】以下程序实现了二叉树的结点删除算法,若树中存在要删除的结点,则删除它,否则返回。 FindNode ()函数能够在二叉树中找到给定值的结点,并返回其地址和父结点。【C++程序】template < class T >void BinSTree < T >: :Delete( const T item){TreeNode < T > * DelNodePtr, * ParNodePtr, * RepNodePtr;if(( DelNodePtr = FindNode (item,ParNodePtr)) = = NULL)(1)if(DelNodePtr→right = = NULL) //被删除结点只有一个子结点的情况RepNodePtr = DelNodePtr→left;else if( DelNodePtr→left = = NULL)(2);else // 被删除结点有两个子结点的情况{TreeNode < T >* PofRNodePtr = DelNodePtr;RepNodePtr = DelNodePtr→left;while(RepNodePtr→right ! = NULL){ //定位左子树的最右结点PofRNodePtr =RepNodePtr;RepNodePtr = RepNodePtr→right;}if(PofRNodePtr = = DelNodePtr) //左子树没有右子结点(3);else //用左子顷的最右结点替换删除的结点{(4)RepNodePtr→left = DelNodePtr→left;RepNodePtr→right = DelNodePtr→right;}}if (5)//要删除结点是要结点的情况root = RepNodePtr;else if ( DelNodePtr→data < ParNodePtr→Data)ParNodePtr→left = RepNodePtr;elseParNodePtr→right =RepNodePtr;FirstTreeNode ( DelNodePtr ) ;//释放内存资源size→;}

考题 C语言中badtypecast是什么意思?我定义了一个树结点typedefstruct_tree{voiid*data;structtree*left,*right}treenode;在函数中的代码简单点是这样treenode*p=NULL;uniword*q=(uniword*)malloc(sizeof(uniword));//uniword是一个结构体,给他赋值p-data=q;之后调试的时候我想观察(uniword*)p-data的值结果出现badtypecast?

考题 阅读以下说明,Java代码将应填入(n)处的字句写在对应栏内。【说明】链表和栈对象的共同特征是:在数据上执行的操作与在每个对象中实体存储的基本类型无关。例如,一个栈存储实体后,只要保证最后存储的项最先用,最先存储的项最后用,则栈的操作可以从链表的操作中派生得到。程序6-1实现了链表的操作,程序6-2实现了栈操作。import java.io.*;class Node //定义结点{ private String m_content;private Node m_next;Node(String str){ m_content=str;m_next=null; }Node(String str,Node next){ m_content=str;m_next=next; }String getData() //获取结点数据域{ return m_content;}void setNext(Node next] //设置下一个结点值{ m_next=next; }Node getNext() //返回下一个结点{ return m_next; )}【程序6-1】class List{ Node Head;List(){ Head=null; }void insert(String str) //将数据str的结点插入在整个链表前面{ if(Head==null)Head=new Node(str);else(1)}void append(String str) //将数据str的结点插入在整个链表尾部{ Node tempnode=Head;it(tempnode==null)Heed=new Node(str);else{ white(tempnode.getNext()!=null)(2)(3) }}String get() //移出链表第一个结点,并返回该结点的数据域{ Srting temp=new String();if(Head==null){ System.out.println("Errow! from empty list!")System.exit(0); }else{ temp=Head.getData();(4) }return temp;}}【程序6-2】class Stack extends List{ void push(String str) //进栈{ (5) }String pop() //出栈{ return get();}}

考题 阅读以下说明和流程图,从供选择的答案中选出应填入流程图(n)处的字句写在对应栏内。[说明]以下是某图像二元树存储与还原算法的主要思想描述。设一幅2n×2n的二值图像,以:“1”表示黑像素点,以“0”表示白像素点。图像二元树结构表示依赖于图像的二元分割,即交替在X轴方向和Y轴方向上分割。先进行水平分割,分成两个2n-1×2n图像子块,然后进行垂直分割,分成4个2n-1×2n-1的正方形块,如此分割,直到子块只含同一像素点为止。如图8-8为一“E”字的二值图像,对其进行二元分割,相应的二元树如图8-9所示。根据图像二元树的0叶结点和1叶结点的数目,删除多者,保留少者。如“E”字图像的二元树0叶结点较多,裁剪后如图8-10所示。裁剪后图像二元树有4类结点,分别用二进制编码如下:◆ 左右儿子都有的结点,编码为11;◆ 仅有左儿子的结点,编码为10;◆ 仅有右儿子的结点,编码为01;◆ 叶结点,编码为00。存储时,先存储剩余叶结点的类型编码,二进制码00表示0叶结点,11表示1叶结点。再按层次顺序,自左至右存储裁剪后图像二元树各结点的编码。图像二元树的存储算法用C语言描述所定义的数据结构及函数如下:struct Node{ /*图像二元树结点*/street Node*Left;street Node*Righ t;char Pixel;}struct Node Queue[MaxLen]; /*队列*/InitQueue() /*初始化队列Queue的函数; */EmptyQueue () /*判断队列Queue是否为空的数,若空返回1,否则返回0; */AddQueue(Item) /*将Item加到队列Queue的数; */GetQueue() /*取队列Queue第一个元素的函数; */PutCode(Code) /*写2位二进制码Code到文件的函数*/还原算法是存储算法的逆过程,将文件中的二进制码序列转换成图像二元树。还原算法的数据结构与函数与存储算法的相同,还原算法新增了一个函数GetCode ()。GetCode() /*从文件中读2位二进制码的函数*/[C程序]存储算法void Backup (char CutPixel,st ruct Node ImageTree)'/*Cu tP ixel=0表示裁剪0叶结点*/{ InitQueue();AddQueue ( ImageTree ) ;PutCode ( 1-CutPixel ) ;While ( !EmptyQueue ( ) ){ TreeNode= GetQueue ( ) ;if (TreeNode→Left==NULL){ PutCode (0) ;continue:}Tl= TreeNode→Left;Tr= TreeNode→R igh t;if ( Tl→Left= = NULL Tl→Pixel= = CutPixel )L=0;else{(1);AddQueue ( Tl ) ;}if ( Tr→Left= = NULL Tr→Pixel= = CutPixel )R=0;else{(2)AddQueue (T) ;}(3)}}还原算法void Restore ( struct Node *TreeRoot ){ TreeRoot= ( strut Node*)malloc ( sizeof (struct Node)InitQueue ( );AddQueue ( TreeRoot ) ;CutPixel= 1- GetCode ( ) ;while ( ! EmptyQueue ( ) ){ TrecNode= GetQueue ( Queue ) ;NodeCode= GetCode ( ) ;switch ( NodeCode ){case 0:TreeNode→Left = NULL ;TreeNode→Right= NULL&

考题 本题是一个Applet,它显示了一个树型结构。单击树结点的时候,就能将其子结点展开,同时下面的文本框可以显示出所单击的结点的路径,比如单击了根结点下B结点下B2结点,则文本框显示为"[TOP,B,B2]"。import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.tree.*;public class java2 extends JApplet{JTree tree;JTextField jtf;public void init(){Container cp=getContentPane();cp.setLayout(new BorderLayout());top=new DefaultMutableTreeNode("TOP"):DefaultMutableTreeNode a=new Default-MutableTreeNode("A");DefaultMutableTreeNode al = new Default-MutableTreeNode("Al");a.add(a1);DefatIltMutableTreeNode a2=new Default-MutableTreeNode("A2");a.add(a2);DefaultMutableTreeNode a3=new Default-MutableTreeNode("A3");a.add(a3);DefaultMutableTreeNode b=new Default-MutableTreeNode("B");DefaultMutableTreeNode bl=new Default-MutableTreeNode("Bl");b.add(b1);DefaultMutableTreeNode b2=new Default-MutableTreeNode("B2");b.add(b2);DefaultMutableTreeNode b3=new Default-MutableTreeNode("B3"):b.add(b3);top.add(a);top.add(b);tree=new JTree(top);int v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;int h=ScrollPaneConstants.HORIZONTAL_SCRoLLBAR_AS_NEEDED;JScrollPane jsp=new JScrollPane(tree,V,h);cp.add(jsp,BorderLayout.CENTER);jtf=new JTextField(20);cp.add(jtf,BorderLayout.SOUTH);tree.addMouseListener(new MouseAdapter(){public void mouseClicked(MouseEvent me){doMouseClicked(me);}});}void doMouseClicked(MouseEvent me){tp=tree.getPathForLocation(me.getX(),me.getY());if(tp!=null)jtf.setText(tp.toString());elsejtf.setText("");}}

考题 本题中定义了一个树型的通信录,窗El左侧是一个树,右侧是一个文本域,单击树的结点,则在右侧文本域中显示相关信息,如果单击的是树结点,则显示对应名字的电话信息。import javax.swing.*;import javax.swing.tree.*;import java.awt.*;import java.awt.event.*;import javax.swing.event.*;class Mytree2 extends JFrame{JTree tree=null;JTextArea text=new JTextArea(20,20);Mytree2(){Container con=getContentPane();DefauhMutableTreeNode root=new Default-MutableTreeNode("同学通信录");DefaultMutableTreeNode tl=new Default-MutableTreeNode("大学同学");DefaultMutableTreeNode t2=new Default-MutableTreeNode("研究生同学");DefaultMutableTreeNode tl l=new Default-MutatleTreeNode("陈艳");DefaultMutableTreeNode tl 2=new Default-MutableTreeNode("李小永");DefaultMutableTreeNode t2 1=new Defauh-MutableTreeNode("王小小");DefauhMutableTreeNode t2 2=new Defauh-MutableTreeNode("董小");setTitle("java2");root.add(t1);root.add(t2);tl.add(t1_1);tl.add(t1_2);t2.add(t2_1);t2.add(t2_2);tree=new JTree(root);JSerollPane scrollpane=new JScrollPane(text);JSplitPane splitpane=new JSplitPane(JSplitPane.HORIZONTAL SPLIT,true,tree,scrollpane);tree.addTreeSeleetionListener(this);con.add(splitpane);addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){System.exit(0);}});setVisible(true);setBounds(70,80,200,300);}public void valueChanged(TreeSelectionEvent e){if(e.getSouree()= =tree){DefauhMutableTreeNode node=(DefaultMutableTreeNode)tree.getLastSelected-PathComponent();if(node.isLeaf())(String str= ;if(str.equals("陈艳"))(text.setText(str+":联系电话:0411-4209876");}else if(str.equals("李小永")){text.setText(str+":联系电话:010-62789876");}else if(str.equals("王小小")){text.setText(str+":联系电话:0430-63596677");)else if(str.equals("董小")){text.setText(str+":联系电话:020-85192789");}}else{text.setText(node.getUserObject().toString());}}}}public class java2{public static void main(String args[]){Mytree2 win=new Mytree2();win.pack();}}

考题 设链表中的结点是NODE类型的结构体变量,且有NODE*p;为了申请一个新结点,并由p指向该结点,可用以下语句()。Ap=(NODE*)malloc(sizeof(p));Bp=(*NODE)malloc(sizeof(NODE));Cp=(NODE)malloc(sizeof(p));Dp=(NODE*)malloc(sizeof(NODE));

考题 treeView1.Nodes[1].Nodes[0]代表了控件treeView1的()。 A、第1个根节点的第1个子节点B、第1个根节点的第2个子节点C、第2个根节点的第1个子节点D、第2个根节点的第2个子节点

考题 A client is experiencing issues after cloning an LPAR using alt_disk_install. DLPAR functions are not available for the new LPAR. Also, there is a lot of network traffic to the HMC. What is the most probable cause of this problem?()A、DLPAR functions are not available for cloned partitionsB、The new partition has the same node number as the original LPARC、Additional filesets need to be reinstalled after the alt_disk_install cloningD、The speed and duplex settings on the Ethernet adapter on the new LPAR is misconfigured

考题 决策树中不包含一下哪种结点()A、根结点(root node)B、内部结点(internal node)C、外部结点(external node)D、叶结点(leaf node)

考题 如果设treeView1=newTreeView(),则treeView1.Nodes.Add("根节点")返回的是一个()类型的值。A、TreeNodeB、intC、stringD、TreeView

考题 如果设treeView1=new TreeView(),TreeNode node=new TreeNode("根结点"),则treeView1.Nodes.Add(node)返回的是一个类型的值。()A、TreeNode;B、int;C、string;D、TreeView;

考题 如果设treeView1=new TreeView(),则treeView1.Nodes.Add("根节点")返回的是一个()类型的值。A、TreeNodeB、intC、stringD、TreeView

考题 Company.com recently updated the programs used in an HACMP pre-event. The procedure Involved coping the new code over the old code in the appropriate directory on one of the nodes as indicated by the HACMP event entry. The cluster was synchronized. During a fallover test, the backup system did not behave as expected.  What is the most likely problem?()  A、 The new pre-event program was node locked to a hostnameB、 The new pre-event program was not made executable on al nodes.C、 The new pre-event program was not compatible with the backup machine.D、 The new pre-event program was not propagated to all the nodes in the cluster.

考题 Company.com is migrating from a third party managed disk subsystem to an IBM TotalStorage Enterprise Storage Server. Connection of the new storage server is complete, and it has been tested on all of the nodes in the three node HACMP cluster.  How does the customer migrate to the new storage server with minimum down time?()A、 Shut down one node at a time and let the other node serve the applicationB、 Stop HACMP with the forced option and perform migration of the disks on one node,then restart HACMPC、 Stop both nodes and perform the migration all at once using standard AIX commands in parallel, then restart the clusterD、 Use C-SPOC to add the new disks to the cluster and migrate the information off the existing disks, then remove the old disks with C-SPOC

考题 If using alt_disk_install to install AIX on new LPARs, which of the following will be necessary after booting the new AIX image?()A、Restart the rsct and inetd daemonsB、Customize the node setting in /etc/servicesC、Rename the rootvg filesystems to their original namesD、Customize the node_id file and restart the rsct daemons

考题 You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to develop a new control for the application.You need to ensure that the control extends the TreeView control by adding a custom node tag and a highlight color.What should you do?()A、Override the OnPaint method.B、Write a code segment in the DrawNode event handler to specify the highlight color.C、Set the DrawMode property of the control to OwnerDrawAll, and then implement a custom DrawNode event handler.D、Set the DrawMode property of the control to OwnerDrawText,and then implement a custom DrawNode event handler.

考题 单选题Company.com is migrating from a third party managed disk subsystem to an IBM TotalStorage Enterprise Storage Server. Connection of the new storage server is complete, and it has been tested on all of the nodes in the three node HACMP cluster.  How does the customer migrate to the new storage server with minimum down time?()A  Shut down one node at a time and let the other node serve the applicationB  Stop HACMP with the forced option and perform migration of the disks on one node,then restart HACMPC  Stop both nodes and perform the migration all at once using standard AIX commands in parallel, then restart the clusterD  Use C-SPOC to add the new disks to the cluster and migrate the information off the existing disks, then remove the old disks with C-SPOC

考题 单选题如果设treeView1=new TreeView(),则treeView1.Nodes.Add("根节点")返回的是一个()类型的值。A TreeNodeB intC stringD TreeView

考题 单选题设链表中的结点是NODE类型的结构体变量,且有NODE*p;为了申请一个新结点,并由p指向该结点,可用以下语句()。A p=(NODE*)malloc(sizeof(p));B p=(*NODE)malloc(sizeof(NODE));C p=(NODE)malloc(sizeof(p));D p=(NODE*)malloc(sizeof(NODE));

考题 填空题设线性链表的存储结构如下: struct node {ELEMTP data; /*数据域*/ struct node *next; /*指针域*/ } 试完成下列在链表中值为x的结点前插入一个值为y的新结点。如果x值不存在,则把新结点插在表尾的算法。 void inserty(struct node *head,ELEMTP x,ELEMTP y) {s=(struct node *)malloc(sizeof(struct node)); (); if(){s-nexr=head;head=s;} else { q=head;p=q-next; while(p-dqta!=xp-next!=NULL){q=p;()} if(p-data= = x){q-next=s;s-next=p;} else{p-next=s;s-next=NULL;} } }

考题 多选题You create a Web Form that contains a TreeView control. The TreeView control allows users to navigate within the Marketing section of your Web site. The following XML defines the site map for your site. You need to bind the TreeView control to the site map data so that users can navigate only within the Marketing section. Which three actions should you perform?()AAdd a SiteMapDataSource control to the Web Form and bind the TreeView control to it.BAdd a SiteMapPath control to the Web Form and bind the TreeView control to it.CEmbed the site map XML within the SiteMap node of a Web.sitemap file.DEmbed the site map XML within the AppSettings node of a Web.config file.ESet the StartingNodeUrl property of the SiteMapDataSource control to ~/Marketing.aspx.FSet the SkipLinkText property of the SiteMapPath control to Sales.

考题 单选题如果设treeView1=newTreeView(),则treeView1.Nodes.Add("根节点")返回的是一个()类型的值。A TreeNodeB intC stringD TreeView

考题 单选题treeView1.Nodes[1].Nodes[0]代表了控件treeView1的()。A 第1个根节点的第1个子节点B 第1个根节点的第2个子节点C 第2个根节点的第1个子节点D 第2个根节点的第2个子节点