Algo lab/notes/lists 67

จาก Theory Wiki
รุ่นแก้ไขเมื่อ 04:44, 26 สิงหาคม 2567 โดย Jittat (คุย | มีส่วนร่วม) (→‎2D-array tasks)
(ต่าง) ←รุ่นแก้ไขก่อนหน้า | รุ่นแก้ไขล่าสุด (ต่าง) | รุ่นแก้ไขถัดไป→ (ต่าง)
ไปยังการนำทาง ไปยังการค้นหา

Linked list tasks

  • Queues (wikipedia)
    • b2_icecream1 - you can implement queues using list. (you can use push_back to add something to the queue and use front and pop_front to take stuff out)
    • b3_icecream2
    • Templates: icecream1
  • Linked lists
    • mid61_cookies - linked lists insertion, traversal, and deletion
    • mid62_bonus - linked lists, iteration, insertion
    • mid64_colorrocks - linked lists (or array)
    • mid65_zamoozooma - linked lists, insertion (push_front, push_back), deletion
      • You need to do some book keeping to make sure you know that some number is in the list.
      • Since the numbers of the balls are in the range 1 - 200000, you can simply use an array to for that. You have to be careful to update the array when balls are removed as well.
      • sample code

2D-array tasks

  • mid63_table
  • mid64_slot - you can try all possible rotations (probably using 3-level nested loops)