2129 - IP_2020_YOU_HW6 Scoreboard

Time

2020/10/20 12:00:00 2020/10/27 12:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12920 Implement Queue Using Linked List
12922 Where's Wally?

12920 - Implement Queue Using Linked List   

Description

Please use the provided two files, main.c and function.h, to implement a queue. Includes following functions:

  1. Enqueue: insert an element into a queue.
  2. Dequeue: remove an element from a queue.
  3. Print the first element: print the first element’s value inside a queue.
  4. Print the last element: print the last element’s value inside a queue.
  5. Check if it is empty: Check if a queue is empty.

Note that:

  1. A Queue data structure shold follow FIFO(first in first out) rule.
  2. The first element means the first insert element, and the last element means the latest insert element.
  3. Print nothing if there is no first element and the last element.

Go download function.c, and only need to submit function.c.

Input

Legal commands:

  1. “enqueue” with an integer N in a new line: Insert an element which value is N into the queue.
  2. “dequeue”: remove the first element inside the queue and return its pointer. If the queue is empty return NULL.
  3. “front”: peak the first element inside the queue and print its value. Print nothing if the queue is empty.
  4. “back”: peak the last element inside the queue and print its value. Print nothing if the queue is empty.
  5. “isempty?”: Check if the queue is empty, and print "Yes\n" or "No\n".
  6. “debug”: You may use this to traversal your queue and check if it’s correct. Use it!!!

Output

No need to handle output. Please use function.c above.

Sample Input  Download

Sample Output  Download

Partial Judge Code

12920.c

Partial Judge Header

12920.h

Tags




Discuss




12922 - Where's Wally?   

Description

Given a 7 times 7 character board. Please find the word “WALLY” that can be formed by a sequence of adjacent characters on the board and highlight all alphabets in the sequence.

Note that:

  1. It might not has a solution or has one(more than one) solution.
  2. Allow to search eight possible directions.

Input

A word puzzle map.

Note that:

  1. Use Capital letter ‘A~Z’ to represent alphabets inside the map.
  2. Use ‘-’ to hide the alphabets which are not a solution.
  3. Need a ‘Space’ between any two characters.

 

// Possible puzzle map

Z C G C O T Q

J W B C W E W

J Z A L L R R

H Q K A Y M F

K T W L P G H

Q D P G E G J

Q S V C C Y Z

 

// Puzzle solved map

- - - - - - -

- W - - - - -

- - A L L - -

- - - A Y - -

- - W - - - -

- - - - - - -

- - - - - - -

Output

Output should follow below format:

c c c c c c c

c c c c c c c

c c c c c c c

c c c c c c c

c c c c c c c

c c c c c c c

Note that:

  1. Need to have a return value('\n') at the end of your string.
  2. Character c is one of ‘-’, ‘W’, A’, L’, ‘Y’.

Sample Input  Download

Sample Output  Download

Tags




Discuss