edited by
1,453 views

1 Answer

Best answer
5 votes
5 votes

The top down parser actually takes O(n4) if the grammar is left recursive else O(n3) time to parse the string.

Whereas in case of bottom up parser , it will take O(n3) using CYK algorithm which is a dynamic programming solution and takes O(n3)...

Further there are grammars known as S- grammars which takes O(n) time to parse the string..

Reference :  Read the Time and space complexity of top-down parsing part of https://en.wikipedia.org/wiki/Top-down_parsing

Hence both statements given in the question are true..

selected by

Related questions

199
views
0 answers
0 votes
Anusha Motamarri asked Oct 29, 2016
199 views
139
views
0 answers
0 votes
Abhisek Tiwari 4 asked Nov 16, 2018
139 views
State true or false:S1: The depth of a breadth-first search tree on an undirected graph G = (V, E) from an arbitrary vertex v ∈ V is the diameter of the graph G. ( ... smallest d such that every pair of vertices s and t have δ(s, t) ≤ d.)
948
views
0 answers
1 votes
Anusha Motamarri asked Feb 3, 2017
948 views
here SJF is given as well as priorities are given, given answer followes only priority schedulingbut i think priority is used in case where there is a tie between two processes in SJFwhat is the correct approach?
517
views
2 answers
2 votes
Anusha Motamarri asked Oct 25, 2016
517 views
explain