Write a program to reverse a singly linked list? Modify that program to reverse a doubly linked list.
C Microsoft Interview Questions
Write a function to efficiently determine if a linked list has a cycle in it.
Write a function that takes as input a sorted array and modifies the array to compact it, removing duplicates. Also return the new length of the array.
Notes: The input array might be very large.
- input array =
[1, 3, 7, 7, 8, 9, 9, 9, 10]
- transformed array =
[1, 3, 7, 8, 9, 10]
- size = 6
Given two arrays of strings, A and B.
B contains every element in A, and has one additional member, for example:
* A = ['dog', 'cat', 'monkey] * B = ['cat', 'rat', 'dog', 'monkey']
Write a function to find the extra string in B. Do this in O(n)
Express the following table as a static structure, and write a function,
find_routes(source, destination) that efficiently outputs all possible routes.
Source | Dest ~~~~~~ ~~~~ Seattle | LA LA | Florida LA | Maine Florida | Seattle Seattle | Florida
The solution for
find_routes('Seattle', 'Florida') should be
[Seattle -> Florida, Seattle -> LA -> Florida]
Write a function to efficiently convert a floating point number to a rational number. For example, given