Dab tsi yog dequeue piav nrog piv txwv?
Dab tsi yog dequeue piav nrog piv txwv?

Video: Dab tsi yog dequeue piav nrog piv txwv?

Video: Dab tsi yog dequeue piav nrog piv txwv?
Video: Yog hmoov dab tsi - Gao Nou Kue ft. Mang Vang (Official Music Video) New song 2020 2024, Kaum ib hlis
Anonim

Q. Piav ob chav xaus nrog kev pab ntawm haum piv txwv ? Ib tug ob-kawg queue ( dequeue , feem ntau abbreviated rau deque , pronounced lawj) yog cov ntaub ntawv paub daws teeb meem uas siv cov kab uas muaj peev xwm tsuas yog ntxiv rau lossis tshem tawm ntawm pem hauv ntej (lub taub hau) lossis rov qab (tail).

Ib yam li ntawd, dab tsi yog dequeue piav qhia?

A deque , tseem hu ua ob-kawg kab, yog ib qho kev txiav txim sau cov khoom zoo ib yam li cov kab. Nws muaj ob qhov kawg, pem hauv ntej thiab nram qab, thiab cov khoom nyob twj ywm nyob rau hauv kev sau. Hauv kev nkag siab, qhov hybrid linear qauv no muab tag nrho cov peev txheej ntawm pawg thiab cov kab hauv ib qho qauv ntaub ntawv.

Tsis tas li ntawd, Deque siv li cas? A deque feem ntau yog ua raws raws li ib tug sau ntawm nco blocks. Thaum peb ntxig ib lub ntsiab lus kawg nws khaws cia rau hauv qhov kev faib cim xeeb kom txog thaum nws tau sau thiab thaum lub cim xeeb thaiv no tau ntim nrog cov ntsiab lus ces nws faib lub cim xeeb tshiab thiab txuas nrog qhov kawg ntawm lub cim xeeb yav dhau los.

Ib yam li ntawd, nws yog nug, dab tsi yog ob chav xaus nyob rau hauv cov ntaub ntawv qauv?

Ob Chav Ended Queue kuj yog ib Queue cov ntaub ntawv qauv nyob rau hauv uas qhov ntxig thiab tshem tawm kev ua haujlwm ntawm ob qhov kawg (pem hauv ntej thiab nram qab). Qhov ntawd txhais tau tias, peb tuaj yeem ntxig rau ntawm ob qho tib si pem hauv ntej thiab nram qab txoj haujlwm thiab tuaj yeem tshem tawm ntawm ob qho tib si pem hauv ntej thiab nram qab txoj haujlwm.

Enqueue thiab dequeue ua haujlwm li cas?

Koj tuaj yeem ntxiv cov ntsiab lus tshiab ntawm ib sab, thiab tshem tawm cov ntsiab lus los ntawm lwm sab (xws li cov pawg uas tsuas muaj ib sab). Enqueue txhais tau tias yuav ntxiv ib lub ntsiab, dequeue tshem tawm ib lub ntsiab.

Pom zoo: