Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class OrderedList {
- StaticList<Integer> lista;
- public OrderedList(int max){
- lista = new StaticList<>(max);
- }
- public void insert(int e){
- for(int i = 0; i < lista.numElements() - 1; i++){
- if(lista.get(i) > e){
- lista.insert(e, i);
- }
- }
- }
- public StaticList<Integer> getList(){
- return lista;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement