.append(value)
which adds a new node with the given value to the end of the list.insertBefore(value, newVal)
which add a new node with the given newValue immediately before the first value node.insertAfter(value, newVal)
which add a new node with the given newValue immediately after the first value node
- k-th value from the end of a linked list.
- merge two linked list into one.
- take two stacks and use queue implementation
- Create a class called AnimalShelter which holds only dogs and cats. The shelter operates using a first-in, first-out approach.
- Your function should take a string as its only argument, and should return a boolean representing whether or not the brackets in the string are balanced.
- Conduct “FizzBuzz” on a tree while traversing through it. Change the values of each of the nodes dependent on the current node’s value.
- Write a breadth first traversal method which takes a Binary Tree as its unique input. Without utilizing any of the built-in methods available to your language, traverse the input tree using a Breadth-first approach; print every visited node’s value.
- Write a function called
find-maximum-value
which takes binary tree as its only input. Without utilizing any of the built-in methods available to your language, return the maximum value stored in the tree. You can assume that the values stored in the Binary Tree will be numeric.
- Write a function that accepts a lengthy string parameter.
- Write a function called
tree_intersection
that takes two binary tree parameters.
- Write a function that LEFT JOINs two hashmaps into a single data structure.
- The first parameter is a hashmap that has word strings as keys, and a synonym of the key as values.
- The second parameter is a hashmap that has word strings as keys, and antonyms of the key as values.
- Combine the key and corresponding values (if they exist) into a new data structure according to LEFT JOIN logic.
- LEFT JOIN means all the values in the first hashmap are returned, and if values exist in the “right” hashmap, they are appended to the result row. If no values exist in the right hashmap, then some flavor of NULL should be appended to the result row.
- The returned data structure that holds the results is up to you. It doesn’t need to exactly match the output below, so long as it achieves the LEFT JOIN logic.
create a binary tree and a binary search tree
- Binary Tree
preOrder()
postOrder()
inOrder()
- Binary Search Tree
add
contains
Implement a Hashtable with the following methods:
add
: takes in both the key and value. This method should hash the key, and add the key and value pair to the table, handling collisions as needed.get
: takes in the key and returns the value from the table.contains
: takes in the key and returns a boolean, indicating if the key exists in the table already.hash
: takes in an arbitrary key and returns an index in the collection.
O(1)
- Hash Table
add()
get()
contains()
hash()