AS & A Level Computer Science (9618) - Chapter 23: Algorithm (Code + Diagram Explanation)

Поділитися
Вставка
  • Опубліковано 27 гру 2024

КОМЕНТАРІ • 8

  • @jamesganleongyi
    @jamesganleongyi  9 місяців тому

    Hey everyone, you can purchase the slides that I use here 🏬😉:
    Link: www.jamesgan.net/alevelcs
    Thank you for watching and supporting!

  • @AlHadiKhan
    @AlHadiKhan 9 місяців тому

    Your efforts are greatly appreciated. Kindly make a Video about attempting Paper-4.

  • @devluharuwalla1943
    @devluharuwalla1943 3 місяці тому

    Hi sir, really helpful video. I had a question, all these programs are in python syntax right?

  • @blockworld4772
    @blockworld4772 7 місяців тому

    Thank you for the help but I have sooooo many errors, your Queue gets full even if I use the remove_from_queue() function, the stack didn't work because you used = instead of == , for the if statements and the queue couldn't even load because you didn't put global QueuePointers etc etc inside the functions.

    • @jamesganleongyi
      @jamesganleongyi  7 місяців тому

      Hello! I have checked the stack and queue code, they are fine 😅 perhaps you could let me know which timing did the problem occur? Thanks!

  • @johnyangsana911
    @johnyangsana911 4 місяці тому

    32:27. your Graph wrong direction E to F

  • @blockworld4772
    @blockworld4772 7 місяців тому

    For anyone who has trouble getting the queue to work, I tried doing a paper 4 mock and tried implementing the Queue system showed here but I got the comment from my teacher as "overly complicated" :
    def add(newItem):
    global QBack, items
    if items < QSize:
    QBack += 1
    if QBack > QSize - 1: # MINUS 1 IS IMPORTANT SO YOU ARENT OUT OF INDEX or I think you can use >=
    QBack = 0
    Q[QBack] = newItem
    items += 1
    else:
    print("Queue is full cannot add")
    def remove():
    global Q
    global QBack, items, QFront
    if items > 0:
    Q[QFront] = None
    QFront += 1
    items -= 1
    else:
    print("Nothing to remove")
    QFront = 0
    QBack = -1
    QFront = 0
    QBack = -1
    items = 0
    QSize = 5
    Q = [None] * QSize
    add("Venti")
    add("my")
    add("pookie")
    add("bear")
    add("I love")
    add("Lord Barbatos")
    print(Q)
    remove()
    remove()
    remove()
    remove()
    remove()
    add("Anemo Archon")
    add("Ga Ming is pretty cool and relatable")
    add("I want dim sum")
    add("Liyue Harbour")
    add("WOAHH ITS ZHONGLI OH MY GOD HAIIIII")
    add("this should not get added")
    print(Q)
    This may not pass for the pseducode questions in Paper 3 because you have to learn it the way the Cambridge book suggests and this video is close to the pseudocode from the book but in python, but at least this worked for me.

    • @rise6646
      @rise6646 7 місяців тому +1

      Algorithms is a paper 4 topic which you can do in multiple coding systems python,pesudocode,java etc... but thanks for the added info!