# Exercises

0 / 10

Given a binary tree, write a recursive function to return the difference between the sum of all node values at odd levels and sum of all... 0 / 10

The height of a binary tree is the length of the path to the deepest node. An empty tree has a height of 0, a tree with one node has a... 0 / 10

Write a recursive function that increments by one the value for every node in the binary tree pointed at by `root`, then returns the... 0 / 10

Write a recursive function to count the number of leaf nodes in the binary tree pointed at by `root`. You must use the `isLeaf` method to... 0 / 10

We define a "root-to-leaf path" to be any sequence of nodes in a tree starting with the root node and proceeding downward to a leaf. The... 0 / 10

Write a recursive function to set the value for each node in a binary tree to be its depth then return the modified tree. Assume that... 0 / 10

Write a recursive function that returns the sum of the values for all of the nodes of the binary tree with root `root`.
Here are methods... 0 / 10

Given two binary trees, return true if and only if they are mirror images of each other. Note that two empty trees are considered mirror... 0 / 10

Given two binary trees, return true if they are identical (they have nodes with the same values, arranged in the same way).
Here are... 0 / 10

Given two binary trees, return true if and only if they are structurally identical (they have the same shape, but their nodes can have... 0 / 10

Consider the following class definition:
Object data;
}
Create a new node with info 'D' and insert it at the end... 0 / 10

Consider the following class definition:
Object data;
}
Write a while loop to make q refer successively to each... 0 / 10

Consider the following class definition:
Object data;
} 0 / 10

Consider the following class definition:

``class Link{ public Object data; public Link next; } ``

In the method below, you will receive a... 0 / 10

Consider the following class definition:
Object data;
}
Return a reference to the second to last node (null if... 0 / 50

Write a member method balanceBags in Java that implements the following logic: Given a String parameter the methods returns the String... 0 / 10

Consider the following class definition:
Object data;
}
List L has a reference p to the first node. Write code... 0 / 10

Consider the following class definition:
Object data;
}
List L has a reference p to the first node. Write code... 0 / 10

Consider the following class definition:
Object data;
}
List L has a reference p to the first node. Write code... 0 / 10

Consider the following class definition:
Object data;
}
List L has a reference p to the first node. Write code... 0 / 10

Consider the following class definition:
Object data;
}
p is a reference to the first node in a List L. Create a... 0 / 50

Write the member method 'playBagBingo()' that implements the player logic for the game described below. Bag Bingo is a game of chance... 0 / 30

For this assignment, create a method that will turn a fixed-size arrayBag into a set.

A Set is an abstract data type somewhat similar... 0 / 10

Consider the following class definition: Write an `ArrayBasedStack<T>` member method called `reverseString()` that takes a String as a parameter, then uses an ArrayBasedStack...
{"ft_lang_label":"__label__en","ft_lang_prob":0.84353393,"math_prob":0.87430614,"size":3441,"snap":"2023-14-2023-23","text_gpt3_token_len":741,"char_repetition_ratio":0.15478615,"word_repetition_ratio":0.31,"special_character_ratio":0.22725952,"punctuation_ratio":0.18417463,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99168646,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,10,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-06T23:01:17Z\",\"WARC-Record-ID\":\"<urn:uuid:5efd45b2-43ea-4a2e-a2cd-94015ed6da89>\",\"Content-Length\":\"42252\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ea91385a-6943-44b7-9de5-0b8538c90aa0>\",\"WARC-Concurrent-To\":\"<urn:uuid:1213565a-094b-4e79-847f-2061f20085c0>\",\"WARC-IP-Address\":\"128.173.242.145\",\"WARC-Target-URI\":\"https://codeworkoutdev.cs.vt.edu/gym/exercises?page=8\",\"WARC-Payload-Digest\":\"sha1:VOGOZZ7LGE2MOGSTODQOK6HCFFPJFPYT\",\"WARC-Block-Digest\":\"sha1:FVDRVSJ7MICHKQVQXY6GXOTGJUNRV7FA\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224653183.5_warc_CC-MAIN-20230606214755-20230607004755-00198.warc.gz\"}"}