Popular posts from this blog
Given two sorted arrays of size m and n .Find the number of common elements in them and also find what are that common elements.
This can be done in 3 ways :(considering worst case)//only for sorted 1. O(m*n) // if m == n, then (n*n) 2. O(nLog(m))// if m>n else O(mLog(n)) Using Binary search 3. O(m + n) // this is optimal worst case time// using concept of merge sort for example : array a[] = { 10,20,30.40,50,60,70,80,90};//only for sorted array b[] = { 10,15,20,25,30}; output : 10 20 30 number of same elements : 3 follow me on : Instagram Twitter LinkedIn my website facebook Whatsapp gmail
Chomsky's hierarchy Explanation :
Chomsky's hierarchy Explanation and its types : Connect with me on According to Chomsky, there are 4 types of Finite language. T0,T1,T2,T3. Chomsky's hierarchy Diagram: T0 is superset of T1,T2,T3. T1 IS SUPERSET OF T2,T3. T2 IS SUPERSET OF T3. connect with me on A Topic from Theory of Computation (TOC) Chomsky's hierarchy Explanation Table: Language type Accepted Language Accepting machine T3 REGULAR LANGUAGE FINITE AUTOMATA T2 CONTEXT FREE LANGUAGE (CFL) PUSH DOWN AUTOMATA (PDA) T1 CONTEXT SENSETIVE LANGUAGE (CSL) LINEAR BOUND AUTOMATA (LBA) T0 RECURSSIVE ENUMERABLE LANGUAGE (REL) TURING MACHINE Knowledgable Ti...
Comments
Post a Comment