Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Filter
Profile
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
Questions by Bongbirdie
0
votes
1
answer
1
Mathematical Logic
What is the difference between =>, <=> and ->? Are => and -> used in the same way? => is logical implication and <=> is equivalence right? Then why does in some questions, => and <=> is read as 'if then'? '->' symbol is for if then right? Refer to this: https://gateoverflow.in/3454/gate2007-it-21
What is the difference between =>, <= and ->?Are = and - used in the same way? = is logical implication and <= is equivalence right? Then why does in some questions, = an...
357
views
asked
Jun 10, 2017
Mathematical Logic
mathematical-logic
discrete-mathematics
+
–
0
votes
1
answer
2
Propositional Logic
#Discrete_Maths #Logic I have a doubt in the following concept. Suppose we're given: (A v B) ^ ( B v C)...when we open the brackets, do we apply distributive law or just open it..as in 1. A v B ^ B v C = A v B ^ C 2. ... see that sometimes, the brackets are opened just like that and in other cases, distributive law is used. How to differentiate what to do when? Please help!
#Discrete_Maths#LogicI have a doubt in the following concept.Suppose we're given:(A v B) ^ ( B v C)...when we open the brackets, do we apply distributive law or just open...
454
views
asked
Jun 6, 2017
Mathematical Logic
propositional-logic
discrete-mathematics
+
–
0
votes
4
answers
3
programming Strings
For the following program: #include<stdio.h> char *getString() { char *str = "GfG"; return str; } int main() {getString(); printf("%s", str); // Gives error, but printf("%s", getString()); works perfect. return ... does not get destroyed, wh can't we print the value using str? Why does the program give error saying that str is undeclared?
For the following program:#include<stdio.h>char *getString(){char *str = "GfG";return str; }int main(){getString();printf("%s", str); // Gives error, but printf("%s", get...
1.5k
views
asked
May 29, 2017
Programming in C
programming-in-c
strings
variable-scope
+
–
0
votes
2
answers
4
Programming Scope of variables
The following program runs perfectly fine without showing compilation error. I am unable to understand why as 'c' is a local variable of 'function_addition'. So, shouldn't it throw an error? #include<stdio.h> int ... ambiguity as to why the first one prints the value of c correctly whereas the second program shows an error.
The following program runs perfectly fine without showing compilation error. I am unable to understand why as 'c' is a local variable of 'function_addition'. So, shouldn'...
998
views
asked
May 28, 2017
Programming in C
programming-in-c
scoping-rule
variable-scope
+
–
3
votes
1
answer
5
Longest Common Subsequence
For finding longest common subsequence(LCS), standard sources mention that the recursive procedure consisting of the recursive tree occupies O(m+n) space( WITHOUT applying Dynamic Programming). I am unable to understand why is space occupied O(m+n)? Consider the tree of LCS(3 ... value of2^ k = O(m+n) and hence, space should be k=log(m+n). What's wrong with my logic?
For finding longest common subsequence(LCS), standard sources mention that the recursive procedure consisting of the recursive tree occupies O(m+n) space( WITHOUT applyin...
1.4k
views
asked
May 17, 2017
Algorithms
algorithms
longest-common-subsequence
dynamic-programming
+
–
0
votes
0
answers
6
GATE Graph Theory
Let G = (V, E) be a directed graph where V is the set of vertices and E the set of edges. Then which one of the following graphs has the same strongly connected components as G? ( A ) G1 = (V, E1) where E1 = {(u, v) | (u, v) ∉ E} ( B ) G2 ... D ) G4 = (V4, E) where V4 is the set of vertices in G which are not isolated Can anyone give a detailed answer to this question, please? :)
Let G = (V, E) be a directed graph where V is the set of vertices and E the set of edges. Then which one of the following graphs has the same strongly connected component...
569
views
asked
May 12, 2017
Graph Theory
graph-theory
graph-connectivity
+
–
0
votes
1
answer
7
strings in C
I am trying to implement strcpy manually but am getting error. What is the error? Please help! #include<stdio.h> char* cpy(char *a,char *b) { char *arr; arr=&a; while((*a++=*b++)!='\0'); printf("%s", arr); } int main() { char s[15]="Sreeja"; char t[15]="Mukherjee"; cpy(&s,&t); }
I am trying to implement strcpy manually but am getting error. What is the error? Please help! #include<stdio.h char* cpy(char *a,char *b) { char *arr; arr=&a; ...
976
views
asked
May 2, 2017
Programming in C
programming-in-c
strings
+
–
2
votes
2
answers
8
malloc
What does the following exactly mean? int *p=(int*)malloc(23); Does it mean that the OS allocates a memory of 23 bytes to int(though it requires just 4 bytes)? I know that to make malloc platform independent, we use sizeof, but what if we use the above syntax ... "%d",sizeof(*p)), I get the answer as 4. Why? Should'nt it return 23 since that's what the memory I allocated?
What does the following exactly mean?int *p=(int*)malloc(23);Does it mean that the OS allocates a memory of 23 bytes to int(though it requires just 4 bytes)? I know that ...
813
views
asked
Apr 10, 2017
DS
memory-management
data-structures
programming-in-c
+
–
2
votes
4
answers
9
Bellman Ford Shortest path
Is the below statement correct: Bellman Ford finds all negative weight cycles in the graph. This is true or false?
Is the below statement correct:Bellman Ford finds all negative weight cycles in the graph.This is true or false?
1.9k
views
asked
Apr 6, 2017
Algorithms
algorithms
shortest-path
bellman-ford
true-false
+
–
2
votes
1
answer
10
Bellman Ford
If there is a negative edge cycle present in a graph, we all know that Bellman Ford has the capability to detect it. My doubt is that, even after the presence of a negative weighted cycle, will Bellman Ford Algorithm give the correct answer or it will simply say NO..shortest path cannot be computed!?
If there is a negative edge cycle present in a graph, we all know that Bellman Ford has the capability to detect it. My doubt is that, even after the presence of a negati...
856
views
asked
Apr 6, 2017
Algorithms
shortest-path
bellman-ford
algorithms
+
–
0
votes
1
answer
11
Nested Structures
In nested structures, why can't d value be first assigned to the structure members and then make it nested ? I am getting an error but not understanding why. Here is an example: struct ex{ int i; }; struct ex u; u.i=10; struct ex1 { struct ex d; }; struct ex1 t; t.d.i= 20; printf("%d", t.d.i);
In nested structures, why can't d value be first assigned to the structure members and then make it nested ? I am getting an error but not understanding why. Here is an ...
1.5k
views
asked
Apr 4, 2017
Programming in C
programming-in-c
data-structures
nested-structures
+
–
0
votes
3
answers
12
Graph Theory Path
What is the difference between path and Euler path?
What is the difference between path and Euler path?
650
views
asked
Apr 1, 2017
Graph Theory
graph-theory
engineering-mathematics
euler-path
+
–
1
votes
2
answers
13
Master's theorem
We know that Master's theorem is applicable if for the reccurence relation T(n)=aT(n/b) +Θ(n^k log^p n) ,the conditions: a>=1, b>1, k>=0 and p= any real number are satisfied. My doubt is that if k= not a constant( eg: n^n), then can we apply the theorem since we know n will always be positive so k will be positive only?
We know that Master's theorem is applicable if for the reccurence relation T(n)=aT(n/b) +Θ(n^k log^p n) ,the conditions: a>=1, b>1, k>=0 and p= any real number are sati...
491
views
asked
Mar 4, 2017
Algorithms
master-theorem
algorithms
+
–
0
votes
1
answer
14
Space Complexity of Quick Sort
Is Quick Sort an in-place algorithm? I read somewhere that although its space complexity is O(logn) [best case], it is referred to as an in place algo by Wikipedia because it involves just swapping of elements. What is Correct?
Is Quick Sort an in-place algorithm?I read somewhere that although its space complexity is O(logn) [best case], it is referred to as an in place algo by Wikipedia because...
1.6k
views
asked
Feb 28, 2017
Algorithms
quick-sort
+
–
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register