pub struct MyCircularQueue { /* private fields */ }
Implementations§
Source§impl MyCircularQueue
impl MyCircularQueue
Sourcepub fn new(k: i32) -> Self
pub fn new(k: i32) -> Self
Initialize your data structure here. Set the size of the queue to be k.
Sourcepub fn en_queue(&mut self, value: i32) -> bool
pub fn en_queue(&mut self, value: i32) -> bool
Insert an element into the circular queue. Return true if the operation is successful.
Trait Implementations§
Source§impl Clone for MyCircularQueue
impl Clone for MyCircularQueue
Source§fn clone(&self) -> MyCircularQueue
fn clone(&self) -> MyCircularQueue
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for MyCircularQueue
impl RefUnwindSafe for MyCircularQueue
impl Send for MyCircularQueue
impl Sync for MyCircularQueue
impl Unpin for MyCircularQueue
impl UnwindSafe for MyCircularQueue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more