Results 1 to 6 of 6
  1. #1

    Default enqueue,dequeue,pop,push


    hey,programming expert here sa java...do u have any knowledge about this enqueue,dequeue,pop,push...do u have any example?

  2. #2
    don't know about java but i bet those are methods for storing and retrieving data from special data objects. push/pop is traditionally used with a stack.

  3. #3
    ang enqueue and dequeue kai gamit sa queue sad ^^

    Data Structures & Algorithms - Stacks & Queues

  4. #4
    Quote Originally Posted by skeptic_rob View Post
    hey,programming expert here sa java...do u have any knowledge about this enqueue,dequeue,pop,push...do u have any example?
    enqueue,dequeue,pop,push are just basically insertion and deletion of an object from an ordered list

    push(insert) and pop(delete) - used for a STACK wherein it follows the algo of Last In First Out(LIFO) which means that the Last item that was push(inserted) will be the first item deleted when you pop

    enqueue(insert) and dequeue(delete) - used for a QUEUE wherein it follows the algo of First In First Out(FIFO) which means that the first item that was enqueue(inserted) will be the first item deleted when you dequeue

    hope that helps.

  5. #5
    Quote Originally Posted by sui_sassy View Post
    enqueue,dequeue,pop,push are just basically insertion and deletion of an object from an ordered list

    push(insert) and pop(delete) - used for a STACK wherein it follows the algo of Last In First Out(LIFO) which means that the Last item that was push(inserted) will be the first item deleted when you pop

    enqueue(insert) and dequeue(delete) - used for a QUEUE wherein it follows the algo of First In First Out(FIFO) which means that the first item that was enqueue(inserted) will be the first item deleted when you dequeue

    hope that helps.
    sample daw codes kanha simple lang....wla ko ka G

  6. #6
    Sample

    FOR STACK :
    push(9);
    push(2);
    push(5);
    push(10);
    //print the stack (10, 5, 2, 9)
    pop();
    //print the stack (5, 2, 9)

    --> Last In First Out (LAST IN(push) was 10 so when pop was called 10 was FIRST OUT)

    FOR QUEUE:
    enqueue(9);
    enqueue(2);
    enqueue(5);
    enqueue(10);
    //print the queue(10, 5, 2, 9)
    dequeue();
    //print the queue(10, 5, 2)

    --> First In First Out (FIRST IN(enqueue) was 9 so when dequeue was called 9 was FIRST OUT)

  7.    Advertisement

Similar Threads

 
  1. need help for push and pop in C prog
    By koujie in forum Programming
    Replies: 4
    Last Post: 09-15-2011, 12:06 PM
  2. kinsai familiar sa POP DELI na band?local ra ni cla..
    By neishan731 in forum Music & Radio
    Replies: 1
    Last Post: 04-14-2010, 06:30 PM
  3. WHO KNOWS THE BAND POP-DELI?
    By waky in forum Music & Radio
    Replies: 2
    Last Post: 08-13-2009, 01:36 PM
  4. j-pop
    By sab0y in forum Music & Radio
    Replies: 27
    Last Post: 06-02-2006, 10:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top