Question Detail: I am learning C++ and noticed that the running time for the push_back function for vectors is constant “amortized.” The documentation further notes that “If a reallocation happens, the reallocation is itself up to linear in the entire size.” Read More …
Author: ignougroup
How is this grammar LL(1)?
Question Detail: This is a question from the Dragon Book. This is the grammar: $S to AaAb mid BbBa $ $A to varepsilon$ $B to varepsilon$ The question asks how to show that it is LL(1) but not SLR(1). To prove Read More …
Keeping a String Secret in (Open) Source Code
Question Detail: I have finished developing an app for Android and intend to publish it with GPL — I want it to be open source. However, the nature of the application (a game) is that it asks riddles and has the Read More …
Keeping a String Secret in (Open) Source Code
Question Detail: I have finished developing an app for Android and intend to publish it with GPL — I want it to be open source. However, the nature of the application (a game) is that it asks riddles and has the Read More …
How is this grammar LL(1)?
Question Detail: This is a question from the Dragon Book. This is the grammar: $S to AaAb mid BbBa $ $A to varepsilon$ $B to varepsilon$ The question asks how to show that it is LL(1) but not SLR(1). To prove Read More …
Why is push_back in C++ vectors constant amortized?
Question Detail: I am learning C++ and noticed that the running time for the push_back function for vectors is constant “amortized.” The documentation further notes that “If a reallocation happens, the reallocation is itself up to linear in the entire size.” Read More …
Are there NP problems, not in P and not NP Complete?
Question Detail: Are there any known problems in $mathsf{NP}$ (and not in $mathsf{P}$) that aren’t $mathsf{NP}$ Complete? My understanding is that there are no currently known problems where this is the case, but it hasn’t been ruled out as a possibility. Read More …
Difference between multitasking, multithreading and multiprogramming
Question Detail: I was a little confused between these three terms Multitasking, Multithreading and Multiprogramming Although every one means executing different lines of codes, and for every one we need something like Task State Segment or context to store data for Read More …
Designing a DFA that accepts strings such that nth character from last satisfies condition
Question Detail: This is a homework question, so I am only looking for hints. I got a question in an assignment which states : Design a DFA that accepts strings having 1 as the 4th character from the end, on the Read More …
How to construct and write down a Turing machine for a given language?
Question Detail: In my class we just started learning about Turing machines. I think I understand the concept but am unsure how to syntactically solve any problem related to one. I am presented with the problem: Build a Turing machine accepting Read More …