Computers and Technology
Computers and Technology, 18.12.2019 20:31, imelda249

The is a sum-the-data-in-the-tree question. it asks whether a method, sumall() is a well-written recursive method. you will see three different versions of this question throughout the exam, but the opening assumptions, are identical for all such versions. the only difference between the various questions is the code that implements the method : the general tree in this problem is assumed to be physical, i. e., there is no lazy or soft deletion designed into this tree. we are considering a recursive work-horse method to sum all the (assumed) integer data of the sub-tree. the sub-tree is specified by the root pointer passed in. as usual, some client would pass a root to this method, then this recursive method would generate other (child or sibling) roots to pass to itself when recursing. the members sib and firstchild have the same meanings as in our modules. true of false: the method, as defined below, is a good recursive method for summing the data of the sub-tree, based at the root node passed in. to be true, it must satisfy all the following criteria. if it misses one, it is false: it gives the right sum for the sub-tree, that is, it does not miss counting any data. it does no unnecessary work, micro-management or superfluous testing. it covers all situations (empty trees, null roots, handles all the children, treeclass: : sumall(node *root){ int sibsum, thissum, childrensum; if (root == null) return 0; sibsum = sumall(root-> sib); childrensum = sumall(root-> firstchild); thissum = root-> data; return childrensum + sibsum + thissum; }hint: there are three true-false questions that start out the same in this exam, but each has a different method definition. you may want to come back and review your answer to this question after seeing the other method definitions. only one of the three is true, and the other two are false. a. trueb. false

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:30, caldonjoshhsms2061
What are the steps involved in accepting all the changes in a document? arrange these in order click edit. click accept or reject. click changes. click accept all.
Answers: 1
image
Computers and Technology, 22.06.2019 13:30, baeethtsadia
Asoftware company hired ray, a college graduate to work in their development team. ray is assigned to work in the coding phase of a project. what happens during the coding phase of a software development project? a. the customer receives a working model of the software. b. developers convert the program design into code. c. developers gather requirements directly from the stakeholders. d. testing teams check the product for quality.
Answers: 1
image
Computers and Technology, 22.06.2019 19:00, detrickboucicaut
The fourth generation of computers emerged between 1970s and 1980s. which technological advancement brought about this generation of computers? which computer architecture was used most in this generation?
Answers: 3
image
Computers and Technology, 23.06.2019 12:20, jshhs
When guido van rossum created python, he wanted to make a language that was more than other programming languages. a. code-based b. human-readable c. complex d. functional
Answers: 1
Do you know the correct answer?
The is a sum-the-data-in-the-tree question. it asks whether a method, sumall() is a well-written rec...

Questions in other subjects:

Konu
Chemistry, 08.01.2021 14:00
Konu
Mathematics, 08.01.2021 14:00
Konu
Mathematics, 08.01.2021 14:00
Konu
English, 08.01.2021 14:00
Konu
Mathematics, 08.01.2021 14:00