Hey there! Sign in to join this conversationNew here? Join for free

Elements in a stack (pop/push) Watch

Announcements
    • Thread Starter
    Offline

    12
    ReputationRep:
    The correct solution for the problem below is 3.

    Name:  pop.jpg
Views: 18
Size:  26.2 KB

    I'd have thought it would go:

    8
    6
    4
    2

    delete 8
    insert 3
    delete 3

    so now have:

    6
    4
    2

    insert 4, 6, 7 then delete these.

    so have:
    6
    4
    2

    So answer of 6. Where have I gone wrong?

    Thanks!
    • Very Important Poster
    Offline

    21
    ReputationRep:
    (Original post by little pixie)
    The correct solution for the problem below is 3.

    Name:  pop.jpg
Views: 18
Size:  26.2 KB

    I'd have thought it would go:

    8
    6
    4
    2

    delete 8
    insert 3
    delete 3

    so now have:

    6
    4
    2

    insert 4, 6, 7 then delete these.

    so have:
    6
    4
    2

    So answer of 6. Where have I gone wrong?

    Thanks!
    I agree, I think the answer is 6 too.
    Offline

    18
    ReputationRep:
    I got 6 too
    Offline

    18
    ReputationRep:
    Name:  Capture.JPG
Views: 12
Size:  42.5 KB
 
 
 
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • Poll
    Will you be richer or poorer than your parents?
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

    Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

    Quick reply
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.