Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Hot questions in Programming and DS
2
votes
3
answers
2731
mock test
Consider n elements that are equally distributed in k stacks. In each stack, elements of it are arranged in ascending order (min is at the top in each of the stack and then increasing downwards). Given a queue of size n in which we have to put all n elements in increasing order. What will be the time complexity of the best known algorithm?
Consider n elements that are equally distributed in k stacks. In each stack, elements of it are arranged in ascending order (min is at the top in each of the stack and th...
chandra sai
3.1k
views
chandra sai
asked
Nov 4, 2017
DS
stack
algorithms
data-structures
+
–
1
votes
1
answer
2732
Gate-2011
Pointer to Strings Please clear this concept check this program #include<stdio.h> #include<string.h> int main () { char *ptr = "Gateoverflow"; printf ("String = %s", ptr); //1 printf ("\tAddress of string literal = %u\ ... of string literal = $4195892$ Doubt : Why first print statement does not print the addresses of first character of the string ?
Pointer to StringsPlease clear this concept check this program #include<stdio.h #include<string.h int main () { char *ptr = "Gateoverflow"; printf ("String = %s", ptr); /...
hsmart
705
views
hsmart
asked
Mar 20, 2018
Programming in C
programming-in-c
+
–
0
votes
0
answers
2733
suggestion
can anyone help me how to prepare the c programming language for gate?
can anyone help me how to prepare the c programming language for gate?
priyam saha
242
views
priyam saha
asked
Apr 27, 2018
0
votes
1
answer
2734
Passing array as function argument
#include<stdio.h> void temp(int a[]); main(){ int a[5]={1,2,3,4,5}; printf("%d", sizeof(a)); temp(a); } void temp(int a[]){ printf(" %d", sizeof(a)); } Output of above code is, given size of int is 4 byte $20$ $20$ $20$ $8$ $8$ $8$ $8$ $20$
#include<stdio.h void temp(int a[]); main(){ int a[5]={1,2,3,4,5}; printf("%d", sizeof(a)); temp(a); } void temp(int a[]){ printf(" %d", sizeof(a)); }Output of above code...
hacker16
552
views
hacker16
asked
Apr 5, 2018
Programming in C
programming-in-c
+
–
3
votes
1
answer
2735
Programming
#include<stdio.h> int main() { char arr[5][7][6]; char *p[5][7][6]; printf("%d\t", (unsigned)(arr+1)-(unsigned)arr); printf("%d", (unsigned)(p+1)-(unsigned)p); } Please enlighten about the 2nd printf statement. Also what is the difference between the two statements?
#include<stdio.h int main() { char arr[5][7][6]; char *p[5][7][6]; printf("%d\t", (unsigned)(arr+1)-(unsigned)arr); printf("%d", (unsigned)(p+1)-(unsigned)p); }Please enl...
just_bhavana
1.6k
views
just_bhavana
asked
Jan 18, 2018
Programming in C
non-gate
+
–
20
votes
1
answer
2736
GATE CSE 2005 | Question: 34
A priority queue is implemented as a Max-Heap. Initially, it has $5$ elements. The level-order traversal of the heap is: $10, 8, 5, 3, 2$. Two new elements $1$ and $7$ ... $10, 8, 7, 2, 3, 1, 5$ $10, 8, 7, 1, 2, 3, 5$ $10, 8, 7, 3, 2, 1, 5$
A priority queue is implemented as a Max-Heap. Initially, it has $5$ elements. The level-order traversal of the heap is: $10, 8, 5, 3, 2$. Two new elements $1$ and $7$ ar...
Kathleen
14.1k
views
Kathleen
asked
Sep 22, 2014
DS
gatecse-2005
data-structures
binary-heap
normal
+
–
1
votes
2
answers
2737
Practice Question
#include<stdio.h> int main(void) { int p = 1; int q = 0; q = p++ + p++; printf("%d %d",p,q); return 0; } Output is Showing $3,3$ How ?
#include<stdio.h int main(void) { int p = 1; int q = 0; q = p++ + p++; printf("%d %d",p,q); return 0; }Output is Showing $3,3$ How ?
Nikhil Patil
1.2k
views
Nikhil Patil
asked
Feb 10, 2018
Programming in C
programming-in-c
+
–
1
votes
1
answer
2738
self doubt
#include<stdio.h> main() { char *p = 0; *p = 'a'; printf("value in pointer p is %c\n",*p); } What is the output of this code ? Why?
#include<stdio.h main() { char *p = 0; *p = 'a'; printf("value in pointer p is %c\n",*p); }What is the output of this code ? Why?
Raj Kumar 7
396
views
Raj Kumar 7
asked
Mar 30, 2018
Programming in C
programming-in-c
+
–
1
votes
1
answer
2739
#Test series
what is the output?
what is the output?
himgta
338
views
himgta
asked
Apr 13, 2018
2
votes
1
answer
2740
Precedence Of Logical Operators in C
#include <stdio.h> #include <iostream> using namespace std; int main() { printf("Hello World"); int a = 10, b = 20, c= 30, d = 40; int e = ++a || ++b || ++c && ++d; // DoubtFull Line cout<<"a = "<<a<< ... final Output should be:- a = 11 b = 20 c = 31 d = 41. but the output is a = 11 b = 20 c = 30 d = 40
#include <stdio.h #include <iostream using namespace std; int main() { printf("Hello World"); int a = 10, b = 20, c= 30, d = 40; int e = ++a || ++b || ++c && ++d; // Doub...
Jason
849
views
Jason
asked
Mar 1, 2018
Programming in C
programming-in-c
+
–
2
votes
1
answer
2741
MadeEasy Test Series 2018: Programming & DS - Binary search Tree
Consider a Binary Search Tree is created using element 1 to n in following order: 3, 2, 1, 6, 5, 4, 9, 8, 7, 12, 11, 10, ....., n – 3, n – 4, n – 5, n – 2, n – 1, n What is the worst time complexity of searching a number in the Binary Search Tree?
Consider a Binary Search Tree is created using element 1 to n in following order: 3, 2, 1, 6, 5, 4, 9, 8, 7, 12, 11, 10, ....., n – 3, n – 4, n �...
charul
545
views
charul
asked
Jan 23, 2018
DS
data-structures
binary-search-tree
made-easy-test-series
+
–
3
votes
2
answers
2742
cprogramming
#include<stdio.h> int *m(); void main(){ int *k=m(); printf("Hello"); printf("%d",k[0]); } int *m(){ int a[2]={5,8}; return a; } What is the output generated? A)hello 5 8 B)hello 5 C)hello followed by garbage D)compilation error
#include<stdio.h>int *m();void main(){int *k=m();printf("Hello");printf("%d",k[0]);}int *m(){int a ={5,8};return a;} What is the output generated?A)hello 5 8B)hello 5C)he...
Satwik Mishra 1
3.8k
views
Satwik Mishra 1
asked
Aug 28, 2017
Programming in C
programming-in-c
+
–
0
votes
0
answers
2743
GO Classroom Problem
I am not getting the problem which is given below. Please help Matrix transposition must be a familiar task. This problem is a generalization of it. We can assume matrix transposition as a permutation of the two dimensions of the matrix. Suppose ... get the dimension values of the input tensor and then again linearize and get the location in the output tensor. file1 transpose
I am not getting the problem which is given below. Please helpMatrix transposition must be a familiar task. This problem is a generalization of it. We can assume matrix ...
ankitgupta.1729
437
views
ankitgupta.1729
asked
Apr 14, 2018
Programming in C
go-classroom
algorithms
programming
+
–
3
votes
1
answer
2744
self doubt
#include <stdio.h> main() { float a ; double b ; scanf("%f %lf",&a, &b); if(a==b) printf ("true\n"); else if(a>b) printf("a>b"); else if(a<b) printf("a<b"); } Case 1: input $a=1, b=1$ output = true ... $a = 1.01, b= 1.01$ output = a<b Can anyone explain output of Case2 and Case3
#include <stdio.h main() { float a ; double b ; scanf("%f %lf",&a, &b); if(a==b) printf ("true\n"); else if(a>b) printf("a>b"); else if(a<b) printf("a<b"); } Case 1: inp...
Raj Kumar 7
395
views
Raj Kumar 7
asked
Mar 30, 2018
Programming in C
programming-in-c
+
–
0
votes
2
answers
2745
Gate Mock
The value of $\color{green}{ab}$, if $\color{red}{ab}$ & $\color{red}{0x3f}$ equals $\color{red}{0x27}$ is __________? $\color{blue}{\text{047}}$ $\color{blue}{\text{0x0f}}$ $\color{blue}{\text{0xf3}}$ $\color{blue}{\text{0x27}}$
The value of $\color{green}{ab}$, if $\color{red}{ab}$ & $\color{red}{0x3f}$ equals $\color{red}{0x27}$ is __________?$\color{blue}{\text{047}}$$\color{blue}{\text{0x0f}}...
Harikesh Kumar
556
views
Harikesh Kumar
asked
Mar 24, 2018
Programming in C
programming-in-c
+
–
1
votes
1
answer
2746
self doubt
give an o(n) algorithm to check whether the given binary tree is bst or not
give an o(n) algorithm to check whether the given binary tree is bst or not
Kaluti
534
views
Kaluti
asked
Mar 31, 2018
DS
data-structures
binary-search-tree
time-complexity
+
–
1
votes
2
answers
2747
Circular queue
The initial configuration of circular queue as follows What is status of states of queue contents after the following sequence of steps enqueue x dequeue enqueue y dequeue dequeue a)x,y,____,_____,_____ b)x,___,y,____,____ c)____,_____,x,y,____ d)_____,x,y,_____,_____
The initial configuration of circular queue as followsWhat is status of states of queue contents after the following sequence of stepsenqueue xdequeueenqueue ydequeuedequ...
srestha
2.8k
views
srestha
asked
Oct 29, 2017
DS
data-structures
circular-queue
queue
easy
+
–
0
votes
0
answers
2748
assignment
Create a new project TMA01 in NetBeans and copy the following program into a new Java source file. public method Q1PartA { public void main(String[] args) { System.out.println('a string"); } } (i) Amend the program to correct the errors indicated ... , copy and paste the error message into your answer file. What mistake has been made? Do the steps until all errors are removed.
Create a new project TMA01 in NetBeans and copy the following program into a new Java source file.public method Q1PartA { public void main(String[] args) { System....
Leo So
194
views
Leo So
asked
Apr 22, 2018
1
votes
0
answers
2749
Programming
void main( ){ int array[2][3]={5,10,15,20,25,30}; int (*ptr) [2][3]=&array; printf("%d",***ptr); printf("%d",***(ptr+1)); printf("%d",**(*ptr+1)); printf("%d",*(*(*ptr+1)+2)); } A) 5 Garbage 20 30 B) Compiler Error C)10 15 30 20 D) 5 15 20 30 E) 5 0 20 0
void main( ){ int array [3]={5,10,15,20,25,30}; int (*ptr) [3]=&array; printf("%d", *ptr); printf("%d", *(ptr+1)); printf("%d", (*ptr+1)); printf("%d",*(*(*ptr+1)+...
yogi_p
2.2k
views
yogi_p
asked
Dec 28, 2017
Programming in C
programming-in-c
+
–
0
votes
0
answers
2750
Implementing Graph Data structure in C++
//Just check create_graph function. #include <iostream> #include <malloc.h> using namespace std; struct Adj_node { int node; struct Adj_node *next; }; typedef struct Adj_node Adj_node; struct Edge { int src, dest; }; typedef struct Edge Edge; ... endl; cin>>e; create_graph(v, e); print_adj_list(); return 0; } How to get rid of this problem?
//Just check create_graph function. #include <iostream #include <malloc.h using namespace std; struct Adj_node { int node; struct Adj_node *next; }; typedef struct Adj_no...
Jason
501
views
Jason
asked
Apr 8, 2018
Programming in C
data-structures
algorithms
graph-algorithms
+
–
Page:
« prev
1
...
132
133
134
135
136
137
138
139
140
141
142
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register