Ú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?:))
- Bittorrent topik
- Anime filmek és sorozatok
- Formula-1
- One mobilszolgáltatások
- Az idei év nagy kérdése: bele lehet férni 8 GB VRAM-ba?
- Milyen TV-t vegyek?
- Óvodások homokozója
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Milyen billentyűzetet vegyek?
- Az elmúlt 30 év legjobb processzorai
- További aktív témák...
- Crucial BX500 500GB 2,5" SSD
- Samsung 960 EVO 250GB M2 NVMe SSD
- Inno3D RTX 3070 ICHILL 8GB / Csavarmatricás! / Beszámítás OK!
- Eladó Konfig Intel Core Ultra 7 265KF 32GB DDR5 2TB SSD RTX5070Ti 16GB O11 EVO Lamborghini!
- Bontatlan Dobozos Új Lenovo Thinkpad T14 G5 Laptop 14" -45% Ultra 7 155U 32/512 FHD+ Magyar!
- Vadiúj VGA-k!! Kamatmentes részletre is! Érdeklődj!!!
- GYÖNYÖRŰ iPhone 14 Pro Max 128GB Deep Purple-1 ÉV GARANCIA - Kártyafüggetlen, MS3913
- Honor 200 Pro 512GB,Újszerű,Dobozaval,12 hónap garanciával
- Bomba ár! HP ProBook 430 G4 - i5-G7 I 8GB I 128GB SSD I HDMI I 13,3" I Cam I W11 I Gari!
- ÁRGARANCIA! Épített KomPhone Ryzen 5 5600X 16/32/64GB RAM RTX 5050 8GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


