fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. class Tree<K extends Comparable<K>, V> {
  11.  
  12. K k;
  13. private Tree<K, V> left, right;
  14. List<K> list;
  15.  
  16. K lookup(K elem) {
  17. return null;
  18. }
  19.  
  20. public List<K> someMethod(K k) {
  21. List<K> L=new LinkedList<K>();
  22. if (lookup(k) != null) {
  23. return someMethod(k, L, 0);
  24. }
  25. return L;
  26. }
  27.  
  28. private List<K> someMethod(K k, List<K> L, int n) {
  29. if (this.k.compareTo(k) == 0) {
  30. L.add(this.k);
  31. return list;
  32. }
  33. if (this.k.compareTo(k) < 0) {
  34. right.someMethod(k, L, n); //error here
  35. L.add(this.k);
  36. }
  37. if (this.k.compareTo(k) > 0) {
  38. left.someMethod(k, L, n); //error here
  39. L.add(this.k);
  40. }
  41. return null;
  42. }
  43. }
  44.  
  45.  
  46. public static void main (String[] args) throws java.lang.Exception
  47. {
  48. // your code goes here
  49. }
  50. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
Standard output is empty