C Data Structures Questions Assuming is upper and lowercase
C++ Data Structures Questions
Assuming <ch> is upper and lowercase letters, the grammar that describes a palindrome is:
Select one:
a. <pal> = empty string | <ch> | a<pal>a | b<pal>b | … | Z<pal>Z
b. <pal> = empty string | a<pal>a | b<pal>b | … | Z<pal>Z
c. No answer is correct
d. <pal> = <ch> | a<pal>a | b<pal>b | … | Z<pal>Z
An identifier must start with a letter and can have a letter or digit follow. The letter followed by a digit or another letter would match the Basics of Grammar of:
Select one:
a. No answer is correct
b. x y means x is followed by y
c. < word > means any instance of word that the definition defines
d. x | y means x or y
An example of a prefix expression is:
Select one:
a. 4 + x
b. + 4 x
c. 4 x +
d. No answer is correct
You cannot use recursion for the HPAir search
Select one:
True
False
An example of a closed-form equation is:
Select one:
a. No answer is correct
b. 2^n - 1
c. moves(n)
d. 2 * moves(N - 1) + 1
Show that the property is true for N = k + 1 would be called what:
Select one:
a. Property is true for an arbitrary k => property is true for k + 1
b. Inductive hypothesis
c. No answer is correct
d. Recurrence relation
Solution
6) b. Inductive hypothesis
5) b. 2^n - 1
4) a. True
3) b. + 4 x
2) b. x y means x is followed by y
1) a. <pal> = empty string | <ch> | a<pal>a | b<pal>b | … | Z<pal>Z

