Writing regular expressions describing languages of strings.
Write a regular expression describing the language of strings that have at least two 1's. The language consists of 0's and 1's.
Working with the big-Oh notation.
Why is it true that 20n^3+10n log(n)+5 is O(n^3)? What happened to the other terms? (Note: n^3 means n cubed, or n to the power of 3)
Working with set theory: subtraction, union, and intersection.
If we define the following two sets: A = {1, 2, 3, 4, 5} B = {5, 6, 7, 8, 9} What are the following: A - B? A union B? (The union of A and B) A intersect B? (The intersect of A and B)
If I can show that some NP-complete problem is in P, does P = NP? Why, or why not?
write a code in preparation for creating a spell-checker
Write a code in preparation for creating a spell-checker. I will provide a dictionary. For now don't worry about acutally spell checking: Just write a program that can read in the dictionary word by word. The dictionary is large, having over 125,000 words in it. Reading this in word by word will be easy, since there is one wo ...continues
Write a code in preparation for creating a spell-checker. For now don't worry about actually spell checking: Just write a program that can read in the dictionary word by word. The dictionary is large, having over 125,000 words in it. Reading this in word by word will be easy, since there is one word per line.
h(x) is a hash function performed on an identifier x. Show that if quadratic searching is carried out in the sequence (h(x) + q^2), (h(x) + (q-1)^2), ..., (h(x) + 1), h(x), (h(x) - 1), ..., (h(x) - q^2) with q = (b-1)/2, then the address difference % b between successive buckets being examined is b-2, b-4, b-6, ..., 5, 3, 1, ...continues
Classes in C++, implementing a member function.
I am having a dificult time understanding Classes in C++ and how to implement member functions. Given the attached code I need to: 1: Add the code to implement all of the member functions. 2: Test them from main as coded. 3: Show the order the constructors are called. 4: Show the order the destructors are called.
Writing recursive natural number algorithms.
Write a recursive algorithm to multiply two numbers. Mult(a,b) = a Mult(a,(b-1))+a if b = 1 if b > 1
Writing queue and stack algorithms.
Using only the algorithms in the queue and stack ADT's, write an algorithm called reverseQueue that copies the contents of a queue to another queue, and reverses the order of the data. After data is copied, the data that is at the front of Q1, should be at the rear of Q2.