- Házimozi belépő szinten
- Apple MacBook
- Kormányok / autós szimulátorok topikja
- Úgy tér vissza a Commodore 64, ahogy titkon mindenki várja
- Lassan tálalható a hardverpecsenye
- AMD Ryzen 9 / 7 / 5 / 3 5***(X) "Zen 3" (AM4)
- Milyen TV-t vegyek?
- AMD Ryzen 9 / 7 / 5 7***(X) "Zen 4" (AM5)
- OLED TV topic
- Milyen asztali (teljes vagy fél-) gépet vegyek?
Ú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?:))
- Bomba ár! HP ProBook 440 G6 - i5-8GEN I 8GB I 256SSD I HDMI I 14" FHD I Cam I W10 I Gari!
- Bomba ár! Dell Latitude E7250 - i7-5GEN I 8GB I 256SSD I 12,5" HD I HDMI I Cam I W10 I Garancia!
- Telefon felvásárlás!! Apple Watch SE/Apple Watch SE 2 (2022)
- DELL PowerEdge R730xd 16LFF 160TB+400GB 2U rack - 2xE5-2683v4 (16c/32t),256GB RAM,2x10G NET,HBA330
- Telefon felváráslás!! Xiaomi 13T, Xiaomi 13T Pro, Xiaomi 14T, Xiaomi 14T Pro
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest