Algorithm New Question

Interleaved Parser/Generator algorithm for Context
Is it possible to simultaneously generateorparse CFG.How this will work ? Instead of passing string to parse, I want to pass a template.Lets constrain ourselves with the simplest template language ...... 
Square depth of number in polynomial time
UpdateIt seems that it is simply not possible to do this. Someone also sent me a copy of a different exam where almost the same question was asked, but with the difference that instead of being able ...... 
Analysis of a loop that has a variable expanding e
I know that if a loop variable expands exponentially by a constant exponent k it has a complexity of O(log(logn)). But I couldn't wrap my head around analyzing this function.void foo{int a=0; for(...... 
What time complexity is this nested loop with mult
educative.io think that this is log2(n!) because var increases for each value of n.HOWEVER. Me and my associate think that because var is always < n there is no way that it could be log2(n!) ...... 
Sorting functions according to their BigO complex
Question:Sort the functions in increasing order of bigO complexityf1(n) = (n^0.999999) log nf2(n) = 10000000nf3(n) = 1.0000001^nf4(n) = n^2My answer to this question is that is: 3, 2, 1, 4 (...... 
BigO Notation and Time Complexity Confusion
Our teacher gave us this group homework about time complexity analysis.An algorithm takes 100 seconds to process 5000 data, if it takes 2400 to process 400000 data, what is the time complexity ...... 
Time Complexity when processing output
I'm struggling to figure out what the time complexity for this code would be.def under_ten(input_list : List[int]) > List[int]: res = [] for i in input_list: if i < 10: ...... 
Which Data mining algorithm is better to predict t
I have a task to train the dataset and predict the time value in future.The dataset looks like below:C1 C2 T_Time1 0.123 20121220 01:02:033 0.11 20121224 04:12:34.....98. ...... 
Understanding asymptotic notation
If you have this expression:O(n^4) + Ω(n^2).Does that men that the runtime is somewhere between n^4 and n^2?Or is it that it can be either:from n^2 to infinity,or from n^4 to 1?Thanks for ...... 
probability of winning a special singelimination
Let's say we have N teams in a tournament and based on historical data we know what is the probability of each team winning any other team .Lets put all the probabilities in a matrix called P . P[a][b]...... 
How to properly refactor casebased nested loop?
I have 4 nested loops that used based on the case given. The code is quite similar but there is a little difference in the comparison. Please check this code:If Case 1:for (i = 0; i < length; i++)...... 
Compute the “Time Complexity”
I hope you are doing well,I am computing the Time Complexity of my algorithm which has three nested for, but I did a trick by putting an if in the latest for like:for (i=0 ; i<n1 ; i++){ for (...... 
Understanding why Floyd's tortoise and hare al
I was trying to solve this leetcode problem https://leetcode.com/problems/findtheduplicatenumber/ using my own implementation of the tortoise and hare algorithm which resulted in an infinite loop ...... 
Prim's algorithm “values stored in array
InPrim’s algorithm, if we do not use the minpriority queue and store all the key values in an array, what will be the running time of the modified algorithm?... 
Why is p/n in this equation?
In the book Introduction to the Design and Analysis of Algorithms, it provides pseudocode of this algorithm and analyzes average efficiency of this:ALGORITHM SequentialSearch(A[0..n − 1], K) //......