Perfect Square Problem Statement You're given an array A of size N, the task is to remove all the elements from the array except perfect squares of any integer and print the updated ay For example, if the given array is 9 12 16. Here, 9 and 16 are the perfect square of numbers 3 and 4 respectively. After removing others from the the t Input Format: The input consists of two lines: The first line contains an integer N denoting the size of an array A. The second line contains N integers separated by space denoting elements of the array A. The input will be read from ...
Problem Statement Harry and Potter choose a word string. Harry chose a number M (less than the length of the string) and Potter chose N (less than the length of the string). Harry will cut M letters from the end of the string, add them to the beginning and will give it to Potter. Then, Potter will also cut N letters from the end of the string, add it to the beginning and give it to Harry. This process will continue till they get the original word string back. For a given string and given values of M and N, find the number of turns in which they will get the original word string back . Example If the string is AbcDef, M= 1 and N = 2 the Output must be 4 4604 Explanation This is how the words tend will change. Abcbef > fAbcDe Dejbes- cDefAb AbcDef As...
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