Advertisement
Guest User

gaesgeas

a guest
Jun 26th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. public class OrderedList {
  2.     StaticList<Integer> lista;
  3.    
  4.     public OrderedList(int max){
  5.         lista = new StaticList<>(max);
  6.     }
  7.    
  8.     public void insert(int e){
  9.         for(int i = 0; i < lista.numElements() - 1; i++){
  10.             if(lista.get(i) > e){
  11.                 lista.insert(e, i);
  12.             }
  13.         }
  14.     }
  15.    
  16.     public StaticList<Integer> getList(){
  17.         return lista;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement