Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maximfersko/list-java

My implementation Generic List
https://github.com/maximfersko/list-java

arraylist java-11 linkedlist list

Last synced: 4 days ago
JSON representation

My implementation Generic List

Awesome Lists containing this project

README

        

# List-Java

# How to Run Tests:

```shell
cd List
mvn test
```
# MyList Interface

Defines methods that should be implemented by classes representing list data structures.

## Методы

- `add(int idx, T elm)`: Inserts an element at the specified index.
- `add(T elm)`: Appends an element to the end of the list.
- `get(int idx)`: Returns the element at the specified index.
- `clean()`: Removes all elements from the list, making it empty.
- `remove(int idx)`: Removes the element at the specified index.
- `remove(T elm)`: Removes the first occurrence of the specified element from the list.
- `sort(Comparator comparator)`: Sorts the elements of the list using the specified comparator.
- `size()`: Returns the current size of the list.
- `contains(T elm)`: Checks if the specified element is present in the list.
- `toArray()`: Returns an array containing all elements of the list.

# Класс MyArrayList

Implements the MyList interface using an array to store elements.

# Класс MyLinkedList

Implements the MyList interface using a doubly-linked list.