Write an algorithm to detect if there is a loop in a singly linked list. Hint: The best solution can be done in O(n) time using constant memory.
Write an algorithm to detect if there is a loop in a singly linked list. Hint: The best solution can be done in O(n) time using constant memory.
Write a function the returns the largest sum of contiguous integers in an array. For example, if the input is (-5, 2, 3, -3, 0, 5, -15), the largest sum is 7.
You have a sorted array containing integers in the range of 1… n. Write a function that determines the index of the first instance of a particular number, and how many instances of that number are in the array.
If a large C++ class has implemented the pre-increment and post-increment operators, which would be more efficient? Why?
Complete the following function to clear a block of memory (initialize all the bits to zero). The block of memory starts at pStartByte, and is numBytes long.