I wrote the following code but it doesn't work for nodes except the root node.  public Node deleteSubTree(Node root) {     if(root == null) {         return null;     }     root.left  =  deleteSubTree(root.left);     root.right =  deleteSubTree(root.right);             //System.out.print(" : deleting-"+root.data);     root = null;     return root; }   I am passing the node to be deleted as the argument. Could you please tell what is wrong with this code?
I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?
Can I backup my entire Ubuntu installation to ISO DVD? Can I block incoming calls using wildcard patterns? Recently I have been getting a few unwanted telemarketing calls, all coming from the same source. Each number though is different at the end.  For instance, if the numbers to be blocked are:    123-4567 123-7642 123-8643   It would be convenient for the future to simply block with a wildcard, such as:   123-*   Is this at all possible? How to find the 'sizeof' (a pointer pointing to an array)? What is vertex and edge shading? List files sorted by the number of lines they contain Some forms may contain confidential information - even something basic like where a person lives.   What measures do Cognito Forms take to ensure that data stored within its site is secure? How can I combine hashes in Perl? What is the best way to combine both hashes into %hash1?  I always know that %hash2 and %hash1 always have unique keys.  I would also prefer a single line of code if possible.    $hash1{'1'} = 'red'; $hash1{'2'} = 'blue'; $hash2{'3'} = 'green'; $hash2{'4'} = 'yellow'; Are all multiplicative functions additive? Remove sudo privileges from a user (without deleting the user) In the header of my document I set the maximal author names to 2:  \usepackage[style=authoryear-icomp, maxbibnames=9, maxcitenames=2, backend=biber]{biblatex}   Now, when I cite texts with two authors, LaTeX gives me the following:     (Author_A/ Author_B 2012: 232)   When I have three authors or more, LaTeX makes it:     (Author_A/ Author_B et al. 2012: 232)   But I want LaTeX to just name the first author if there are more than two authors ... like this:     (Author_A et al. 2012: 232)   Any tips on how to achieve this ? How can I rotate an object based on another's offset to it? I have a 3D model of a turret that con rotate around the Y-axis. This turret has a cannon that is significantly off the center of the object. I want the cannon, not the turret, to aim at a specified target. I can only rotate the turret, however, and thus I don't know what equation I need to apply in order to accomplish by objective.  The following image illustrates my problem:  If I have the turret "LookAt()" the target, a laser originating from the cannon will completely miss said target.   If this were a completely top-down scenario, and the cannon were exactly parallel to the turret, then my logic tells me that the fake target should be located at a position that's equal to the actual target plus an offset that's equal to that between the turret and the cannon. However, in my actual scenario, my camera is angled 60º, and the cannon has a slight rotation.  The following image illustrates the scenario:   I'm not sure exactly why, but if I apply that same offset, it only seems to work while aiming at certain distances from the turret.  Is my logic flawed? Am I missing something fundamental here?  Final Edit: the solution provided by @JohnHamilton latest update solves this problem with perfect precision. I have now removed the code and images that I used to illustrate my incorrect implementations. Proving a Composition of Functions is Bijective If I have $f:\mathbb{R}\rightarrow\mathbb{R}$ such that $f$ is onto and $f\circ f\circ f = f$, how can I prove that $f$ is bijective? I know that I only have to prove that it is 1-to-1 because I'm given the fact that it's onto, but how can I use the fact that $f\circ f\circ f=f$ to prove that it is 1-to-1?  Thanks! Lets assume my classes are loaded from a compressed .war file or loaded elsewhere,  how can I discover all the resources in a given package?  Enumerating files will not really work, since this is a war file.  Most likely this will involve using the current classloader?  Is there a library out there that does something like that? Googling revealed only some hacks with listing files. Number of ways a natural number can be written as sum of smaller natural number It is easy to realize that given a natural number N the number of doublets that sum N are $\frac{N+(-1)(N \pmod 2)}{2}$ , so I thought I could reach some recursive formula in the sense that found the number of doublets I could find the number of triplets and so on ...,  example: N=3 the only doublet is 2+1=3 -not said yet but 2+1, and 1+2 count as one- then I could count the number of way the number 2 can be expressed as the indicated sum and got the total number of ways 3 can be written as a sum. But this seems not so efficient, so I was wondering if there is other way to attack the problem and if there is some reference to this problem such as if it is well known its used, once I read that this have a chaotic behavior, and also read It was used in probability but don't remember where I got that information. So if you know something I would be grateful to be notice, thanks in advance. Evaluation of $\int\frac{1}{x^2.(x^4+1)^{\frac{3}{4}}}dx$ How to render a background image in 2.8? How to convert a number to words in MS Excel Android app? Excel Macros are unsupported in Android and there is also no SpellNum Function in Android . I want a function which can convert a number to words. Is there any way we can achieve this ? eg -  40004  , should be converted to Forty Thousand Four Is there is any way to prove the Faraday's law of induction? I want to know if there is any way to prove the Faraday's law or is it just an experimental observed phenomena?  More specifically, is there any reason why the proportionality constant is 1? How did Faraday discover it? I also heard that we can prove Faraday's law using the principle of least action, but is that true? Option to hide rep/badges on the avatar block displayed of you I am trying to install a fresh version of Ubuntu in my computer without touching the windows 10 dual boot! In the Installation Type, the first option seems exactly what i wanted to do.  My question is, is this feature is safe to use? because i don't want to lose any windows files and other NTFS partitions on the hard-disk. Please eliminate my confusion. Note as that i dont need any files or media which are in the ubuntu partition, Thanks.