Skip to content

Problem Set: Linked Lists. Unit X of Software Engineering Fellowship. Unit 1 of Breakthrough Fellowship

License

Notifications You must be signed in to change notification settings

The-Marcy-Lab-School/problem-set-x-linked-lists

Repository files navigation

Problem Set: Linked Lists

Directions

Respond to short response questions in clear, concise sentences directly within this file. Use markdown to ensure that your answers are formatted correctly.

Complete code challenges in linkedList.js.

Use Test Driven Development to guide you. For JavaScript, run npm install to download dependencies. Run npm test to run tests locally. Ensure all tests are passing before submitting this problem set.

Short Response

Do them first! There are only 4 questions.

Class Coding Exercise

  1. Implement a Node class and LinkedList class.

Interview Problems

These are common interview problems and you can find an algorithm to solve them online. That's okay!

However, we encourage you to spend at least 15 minutes attempting to come up with an algorithm on your own before looking it up. If you find an algorithm online, STOP before copying and take time to internalize the algorithm.

  1. Given the head node of a singly linked list, write a function which returns a boolean indicating if the linked list contains a "cycle". A cycle is when a node's next pointer points back to a previous node in the list. This is also sometimes known as a circularly linked list.

  2. Write a function to reverse a linked list in place (don't make a new linked list). The function will take in the head node of the list as an input and return the new head node of the list.

  3. Merge two sorted linked lists and return a new sorted list. The new list should be made by splicing together the nodes of the first two lists.

For example:

Input: 1->2->4, 1->3->4
Output: 1->1->2->3->4->4
  1. Write a function that removes duplicates from a linked list and returns the head node of the list.

About

Problem Set: Linked Lists. Unit X of Software Engineering Fellowship. Unit 1 of Breakthrough Fellowship

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •