Louie Shi's Projects
Returns the first location in the string s1 where any character from the string s2 occurs, or -1 if s1 contains no characters from s2.
Given two strings, write a method to decide if one is a permutation of the other.
Implement an algorithm to delete a node in the middle of a singly linked list, given access to that node.
Program that converts Fahr to Celsius using a function call.
This code converts a hexadecimal number (0xABCD or ABCD) to its respective integer.
Given two (singly) LinkedLists, determine if the two lists intersect. Return the intersecting node.
Returns x with the n bits that begin at position p inverted, leaving the others unchanged.
Implement an algorithm to determine if a string has all unique characters.
Implement an algorithm to find the kth to last element of a singly/doubly linked list.
Given a string, find the length of the longest substring without repeating characters. I used the brute force method, which is extremely bad when the length of the unique substring is long. (TIME WILL EXCEED)
Given a string, find the length of the longest substring without repeating characters. I used the sliding window method to avoid checking duplicates.
Given a circular linked list, implement an algorithm that returns the node at the beginning of the loop.
Deletes each character in s1 that matches any character in the string s2
This program prints the input onto the output, while removing extra spaces at the same time.
Program that prints its input one word per line.
Implement a function to check if a LinkedList is a palindrome.
Remove duplicates from an unsorted linked list with pointers instead of a temporary buffer.
Write code to remove duplicates from an unsorted LinkedList.
Remove trailing blanks and tabs from each line of input, and to delete entirely blank lines
Reverses character string s (Pointer and Non-Pointer Versions)
Returns x with the n bits that begin at position p set to the rightmost n bits of y, leaving the other bits unchanged.
How would you design a stack which, in addition to push and pop, has a function min which returns the minimum element? Push, pop, and min should all operate in O(1) time. (THIS IS BAD when we have a large stack because we have to keep track of the min value for every single element).
You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the 1's digit is at the head of the list. Write a function that adds the two numbers and returns the sum as a linked list.
Implement 3 stacks in a single array using fixed divisions.
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice.