fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6.  
  7. FBList.Person[] arrayList;
  8.  
  9. void expandInsert(int i, FBList.Person person){
  10. FBList.Person[] temp = new FBList.Person[arrayList.length * 2];
  11. for(int index = 0; index < temp.length; index++){
  12. if( i != index){
  13. if(i > 0)
  14. temp[index] = arrayList[index];
  15. if(i == 0)
  16. temp[index + 1] = arrayList[index];
  17. }
  18. else{
  19. temp[i] = person;
  20. i = 0;
  21. index--;
  22. }
  23. }
  24. arrayList = temp;
  25. }
  26.  
  27. public static void main (String[] args) throws java.lang.Exception
  28. {
  29. }
  30. }
  31.  
  32. interface FBList {
  33.  
  34. public int size();
  35.  
  36. public void insert(int i, Person person);
  37.  
  38. public Person remove(int i);
  39.  
  40. public Person lookUp(int i);
  41.  
  42. /**
  43. *A class that defines a person
  44. **/
  45. public class Person {
  46. private String id;
  47. private long phoneNum;
  48.  
  49. public Person(String personID, long phoneNum){
  50. id = personID;
  51. phoneNum = phoneNum;
  52. }
  53. }
  54.  
  55. }
Success #stdin #stdout 0.06s 380224KB
stdin
Standard input is empty
stdout
Standard output is empty