- Audiofil és gamer? Az ASUS megpróbálja
- Hogy milyen lett az ASUS ProArt széria csúcsnotesze? Hát ilyen!
- Nem akármilyen új GeForce jöhet idén
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- HiFi műszaki szemmel - sztereó hangrendszerek
- Autós kamerák
- OLED monitor topic
- SSD kibeszélő
- Vezeték nélküli fülhallgatók
- Kormányok / autós szimulátorok topikja
Ú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?:))
- Gigabyte B560M DS3H V2 alaplap, i5-10400 CPU, 256 GB M.2 SSD, Windows 11
- Újszerű MSI RAIDER GE66 12UH 15.6QHD IPS 240Hz i7-12700H 32GB DDR5 RAM 1TB NVME SSD RTX 3080 175w
- Apple Ipad Pro 11 M2 2022 Space Gray 128gb Wifi+Cellular 1 év garancia
- ASUS ROG STRIX G15 Gaming Laptop - Ryzen 7, 16 GB RAM, RTX 3050 Ti, 512 GB SSD
- Kenwood KR A4010
- 360 áthajthatós! Dell Latitude 5330 2 in 1 i7-1265U 10magos! 16GB 1000GB 13.3" FHD 1 év garancia
- Samsung Galaxy A33 5G / 6/128GB / Kártyafüggetlen / 12Hó Garancia
- 217 - Lenovo Legion 7 (16IRX9) - Intel Core i7-14700HX, RTX 4060
- Gyári DELL, HP, LENOVO,Asus,Fujitsu laptop töltők, 27% ÁFA
- HIBÁTLAN iPhone 12 Pro Max 128GB Pacific Blue -1 ÉV GARANCIA - Kártyafüggetlen, 100% Akkumulátor
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs



