A New Way to Practice

FE Prep is the best platform to prepare for the UCF Foundation Exam, build skills, and track your progress.

Practice Problems
Explore hundreds of real problems pulled from every UCF Foundation exam since 2015. Search, filter, and track what you've done - build confidence in topics and prepare for the FE.
View Problems
Study Plans
Stay organized with study plans for the UCF Foundation Exam. Try the FE-100 — it covers every topic and helps you progress easily. Focus on a single category or practice with mock exams.
View Study Plans
Submission
Write your code or submit your notes to get instant feedback graded by AI using the official FE rubric. See a breakdown of your score, with explanations for each part. Auto-grading is just an estimate, but it's a quick way to check your progress as you practice.

(10 pts) DSN (Linked Lists)

Spring 2023

Consider using a linked list to store a string, where each node, in order, stores one letter in the string. The struct used for a single node is included below. Write a function that takes in two pointers to linked lists storing 2 strings, and prints out the letters in the string in alternating order, starting with the first letter of the first string. If one string runs out of letters, just skip over it. For example, if the two strings passed to the function were "hello" and "computer", then the function should print "hceolmlpouter".

typedef struct node {
    char letter;
    struct node* next;
} node;
     
void printMixed(node* word1, node* word2) { ... }

Official Grading Rubric:

1 pt - attempting to iterate through both lists.

1 pt - advancing a pointer through word1

1 pt - advancing a pointer through word2

2 pts - some sort of artifact to get alternating behavior

2 pts - printing each letter in each list (1 pt for each list)

3 pts - avoiding NULL pointer issues

It is likely that partial credit might be awarded for that last criteria of avoiding NULL pointer issues (ie in some places the solution avoids them, but not all). Partial credit can be awarded.

See the "Student's Solution" and "Submission Feedback" tabs

.
UCF
Made with for UCF Knights
We're here to make studying for the Foundation Exam a little easier — and maybe even a bit more fun. Dive in, practice, and know you're not alone on this journey!
If you're interested in updating content, adding video solutions, fixing mistakes, or hosting FE workshops - you are welcome to join my team.