Merge
Merge
Some terminology:
Node: Object in a tree structure; Z, X and Y are nodes. Branch Line connecting nodes Mother:
The node at the top of a branch, with respect to a node below; Z is the mother of X and Y
Daughter: The node at the bottom of a branch with respect to the node above; X and Y are
daughters of Z
Sisters: Two nodes that have the same mother; two nodes that have been merged with each
other; X and Y are sisters.
Root: The unique node in a tree that has no mother Terminal: A node that has no daughters
Formal restrictions
Of course, the theory of syntax embodied by 8 is far too powerful:
• It will happily derive every imaginable hierarchical structure composed of the words in our list.
• In addition to all of the actual sentences we want, we get all sorts of nonsense like 11:
And we get things that look like real sentences, with the right words in the right order,
but have the wrong structure:
So our job now is to figure out what restrictions to add to our simple hypothesis, constraining
Merge so that it only gives us structures corresponding to grammatical sentences.
Part of the problem, as you may have noticed, is that we haven’t built sensitivity of
syntactic categories into our system yet.
But before we get to that, let’s consider a couple of simple but powerful formal
constraints on the operation of Merge.
First, consider something that has been left implicit until now, but is absolutely crucial:
(13) The Extension Condition Merge always joins syntactic objects at their root nodes.
So the objects in 14a. and b. can only be merged as in 15a., not e.g., as in 15b.
Write c program which will prompt a user to enter the size of the first array and its
elements, the size of the second array and its elements. The program should display the
merge of entered array.
#include<stdio.h>
int main(){
int A[100];
int B[100];
int merge[200];
int position, i;
int s1,s2,s3;
printf("Enter the size of 1st array\n");
scanf("%d",&s1);
printf("Enter elements\n");
for(i=0;i<s1;i++){
scanf("%d",&A[i]);
}
printf("Enter the size of 2nd array\n");
scanf("%d",&s2);
printf("Enter elements\n");
for(i=0;i<s2;i++){
scanf("%d",&B[i]);
}
s3=s1+s2;
for(i=0;i<s1;i++){
merge[position]=A[i];
position++;
}
for(i=0;i<s2;i++){
merge[position]=B[i];
position++;
}
printf("Merge is");
for(i=0;i<s3;i++){
printf("%4d",merge[i]);
}
return 0;
}