ICS-241
M. Bauer
Exam Two
1. Create a binary search tree from the following data which is as balanced as possible.
No leaf node should be more than +/-1 level from any other leaf node. Note: Do not just create a tree from the data encountered in the following order. 78.2, -35.1, 48.2, 12.9,
-14.7, -86.1, 17.4, 92.7, 38.4, -2.8
17.4
-35.1
-86.1
48.2
-14.7
12.9
38.4
-2.8
78.2
92.7
A
B
C
D
G
E
H
I
L
M
J
N
2. Perform a postorder traversal of the tree depicted above.
•
•
•
Traverse its left subtree.
Traverse is right subtree.
Visit the root of the tree.
•
G, L, H, D, B, M, N, I, E, O, J, P, K, F, C, A
3. Evaluate the following prefix notation expression:
* - * 3
…show more content…
Draw a digital logic circuit for the expression:
8. Find a minimal expansion of
1
1
• xz
1
1
1
+ y z + xz
9. Let G = (V,T,S,P) be the phrase structure grammar with V={0,1,A,B,S}, T={0,1}, and the set of productions P consisting of: S → 0AB, S→ 1B, A → 1B01, B → 100.
€
€
€
a. Either show that 0110001001 belongs to the language generated by G or explain why it does not.
It is “not” possible to show that 0110001001 because we are looking for a string that
“starts” with a “0” and ends with a “1”. Since we can only use production S with starting state S → 0AB, the string created that will not end with a “1” but always will end with a
“0”.
S → 0AB → 01B01B → 0110001100
b. Either show that 1100 belongs to the language generated by G or explain why it does not. We can show that 1100 belongs to language generated by G by using production S with start state S→ 1B to be:
S→ 1B → 1100
10. Draw a finite state machine (with output) represented by the following state table.
State
s0 s1 s2 s3 s4
f(0) s1 s2 s2 s0 s3 f(1) s3 s4 s1 s4 s0 g(0)
0
1
1
0
1
g(1)
1
0
1
0
0
0,0
S0
0,1
S1 1,0
1,1
1,1
S2
0,1
1,0
0,0
S3
1,0
S4
0,1
11. What is
N 16. S 17. A 18. P 19. G 20.
bne $s0,$zero,loop # if $s0 is not equal to 0, it will go to the loop
Julia’s alternatives are either buying toys from domestic manufacturers, or importing from foreign countries. Buying from domestic could at least gave $1150 contribution while the contribution of selling imported toys depended on each different results from test sales. The result of tested sales seemed to be a good indicator of realized sales, thus linear regression was calculated according to the test sales and realized sales (excluding those which were not adopted):
If ans <> "Y" And ans <> "y" And ans <> "N" And ans <> "n" Then
0 1 1 0 0 0 0 1 64+32+1=97, This is the ASCII code for A
a. R1 = Add doubling numbers in between each character of simple word, before, through and after
As computer is a machine, so it can’t understand normal language. It can understand only binary language i.e. ‘1’ and ‘0’. Any input language will be converted by it into binary language and understands the command
1. Consider the right most digit of the message to be in an "Odd" position, and assign odd/even
Q1. Many television genres like crime drama, the sitcom and reality shows presuppose tensions and fractions(部分) in ‘normal’(规范的,标准的) social relations. So to win support [i.e. become popular] programmes(节目介绍)are drawn to difficult ideological areas that will then have to be negotiated… Ideology works by masking, displacing(顶替,置换的), and naturalizing(自然化) social problems and contradictions. Discuss a show or shows we encountered in class or one that you think are relevant and identify the ways they mask(掩饰) or displace ideological contradiction and work toward narrative closure(叙事的结尾) and thus ideological resolution(解决).
The right branch has records 1,3,8,9,10. Now we split the right child which has records 1,3,8,9,10. Candidate Split Left Child Node, tL Right Child Node, tR
c) The same as part b above, but now there are four index records at the lowest level of the tree index.
The article is structured in an organized matter he explains his experiment in the first section, giving background history on the subject (language) and gives a brief explanation on his main points. He later explains his main points each one separately and in his conclusion explains how all of his arguments together play a significant role in language. The purpose of this article is to prove that there are more underlying keys that make human unique beside language and recursion. Also, to prove that humans have preexisting conditions that allow them to speak and understand language. However, he also investigates why animals do not evolve any language. He conducts this experiment by testing on tamarin monkeys and discovers that these monkeys do not recombine mental elements to learn recursive- and non- recursive language. The logic his analysis is clear and states the points that play a part in the process of language. For example, voluntary control of sensory- motor systems this explains the preexisting capacity that humans have, which is
Language is a system of communication which consists of a set of sounds and written symbols which are used by the people of a particular country or region for talking or writing. It is considered as an art because when used it able to help a person develop or create a certain picture in the mind. Language being an artifact of culture means that it is an interesting thing that is created by the people. It is an aspect of their way of life of the people. It also helps in development of the people as writers and intellects. As a culture it is a people’s way of life and therefore the impact it has to human beings cannot be under looked.
Trees based algorithm can be used with which type of Target variable/Dependent variable/Response variable in the dataset?