Can someone please suggest a one semester project based on theory of computation of an undergrad level? It is fine if it is totally theoretical or otherwise. thank you.

Member Avatar
Member Avatar
+0 forum 1

for the PDA: d=delta d(q0,a,Z) = {(q0,AZ)} d(q0,b,Z) = {(q0,BZ)} d(q0,a,A) = {(q0,AA)} d(q0,b,A) = {(q0,BA)} d(q0,a,B) = {(q0,AB)} d(q0,b,B) = {(q0,BB)} d(q0,c,Z) = {(q1,Z)} d(q0,c,A) = {(q1,A)} d(q0,c,B) = {(q1,B)} d(q1,a,A) = {(q1,e)} d(q1,b,B) = {(q1,e)} d(q1,e,Z0) = {(q1,e)} the cfg rules are: S -> [q0 Z q] [q0 Z q] -> a[q0 A p] [p Z q] [q0 Z q]-> b[q0 B p] [p Z q] [q0Aq] -> a[q0Ap] [pAq] [q0Aq] -> b[q0Bp] [pAq] [q0Bq] -> a[q0Ap] [pBq] [q0Bq] -> b[q0Bp] [pBq] [q0Zq] -> c[q1Zq] [q0Aq] -> c[q1Aq] [q0Bq] -> c[q1Bq] [q1Aq1] -> a [q1Bq1] -> b [q1Z0q1] …

Member Avatar
Member Avatar
-1 forum 3

I have the following code for shell sort (recursive) given in the question where t[ ] is an array to be sorted, n=no of elements initially. h is any large no initially,say h>n. [CODE]void shell_rec(int t[],int n,int h) { int aux,i; if(h<=0) return; if(n>h) { shell_rec(t,n-h,h); if(t[n]<t[n-h]) { aux=t[n]; i=n; for(i=n;i>=h && aux<t[i-h];i=i-h) t[i]=t[i-h]; t[i]=aux; } } shell_rec(t,n,h/3); }[/CODE] removing tail recursion i get: [CODE]void shell_rec(int t[],int n,int h) { int aux,i; int j; for(j=h;j>0;j=j/3) { if(n>j) { shell_rec(t,n-j,j); if(t[n]<t[n-j]) { aux=t[n]; i=n; for(i=n;i>=j && aux<t[i-j];i=i-j) t[i]=t[i-j]; t[i]=aux; } } } }[/CODE] now i want to remove the recursion using …

Member Avatar
Member Avatar
+0 forum 6

please help me understand when does one use *n=m and when to use n=&m [code]int *n,m; *n=5; m=2; *n=m;[/code] //gives an error

Member Avatar
Member Avatar
+0 forum 13

The End.