- iPhone topik
- Netfone
- Telekom mobilszolgáltatások
- One mobilszolgáltatások
- Xiaomi 17 Ultra - jó az optikája
- Samsung Galaxy Watch (Tizen és Wear OS) ingyenes számlapok, kupon kódok
- Honor 200 Pro - mobilportré
- Samsung Galaxy S26 Ultra - fontossági sorrend
- Bemutatkozott a Poco X7 és X7 Pro
- Átfogó frissítést kapott a Xiaomi 17 család
Új hozzászólás Aktív témák
-
#74220800
törölt tag
Amúgy a feladatom az lenne, hogy saját kezűleg kell implementalni egy priorityqueque-t, minheap struktúrával,
az alábbi interface segitsegevel:/**
* Manages elements within a priority queue. All Elements in this queue must
* implement the Comparable interface. If a element is requested from this data
* structure the smallest one is returned. If there are multiple smallest
* elements, one of them must be returned.
*/
public class PriorityQueue<T extends Comparable<T>> {
/**
* @param maxElements The maximum number of elements this queue can hold.
*/
public PriorityQueue(int maxElements);
/**
* Add e to the queue.
*
* @param e The element which sould be inserted (at the correct position) into the queue.
* @throws IllegalStateException if the queue is already full
*/
public void add(T e) throws IllegalStateException;
/**
* Returns and removes the smallest element in the queue.
*
* @return the smallest element
* @throws IllegalStateException if the queue is empty
*/
public T pop() throws IllegalStateException;
/**
* Return the current number of elements in the queue.
*
* @return the number of elements
*/
public int size();
}Es nem tudom, hogy milyen classot használhatnék e szerint az adatok belső menedzselésére.
A baj az, hogy a beepitett java PriorityQueue is minheapet használ.LinkedList<E> ill. ArrayList<E> szeretnek használni hozza.
Vagy a fenti feladat azt jelenti, hogy a bepitett PriorityQueue-hoz felülirom a pop() es add() metódusokat?
De akkor meg nem tudok indexeket hasznalni, és az algoritmus alapján szerintem mindenképpen olyan kell, ami indexelhető. Nem tudom ...
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- Garanciás Apple iPad Air (2025)gen7 11" M3 Wi-Fi + Cellular (E-SIM)128GB + UAG tok,13 CIKLUS,100% ak
- Eladó OKAI Neon Lite
- T14s Gen6 14" FHD+ IPS Ryzen AI 7 PRO 350 32GB 1TB NVMe ujjlolv IR kam gar
- Lenovo Legion 5 15IRX10 - i7 14700HX - 32GB DDR5 - RTX 5050 8GB - 1TB SSD - SOK GARI -
- Macbook Pro 16" A2141 2019 i7 16/512
- Apple iPhone 17 Pro Silver 256GB használt karcmentes 100% akku (13 ciklus) garancia 2027.02.18.
- BESZÁMÍTÁS! Gigabyte H510M i5 10400F 32GB DDR4 512GB SSD GTX 1070 8GB ZALMAN N4 Corsair 550W
- Utolsó darab! MacBook Pro 16" M1 32GB RAM 27%-os áfás számla
- NEO-t vennél? NE TEDD!!! KÉSZLETKISÖPRÉSI UltraAkcióóó! Air M4 16GB 512GB Garancia - több színben!
- Apple iPhone 17 Sage 256GB használt karcmentes 100% akku (4 ciklus) garancia 2027.03.01.-ig
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest


