Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
1 Commented Post
0 Endorsements
Ranked #4K
~6K People Reached
Interests
chatting wid friends,playing pc games
PC Specs
LINUX

26 Posted Topics

Member Avatar for inspire_all

Hello everyone,i think i know quick sort algorithm.But i need help in figuring out its worst case. Lets look at the below quicksort code----> void quicksort(int arr[],int low,int high) //low and high are pased from main() { int m; if(low<high) { m=partition(arr,low,high); quicksort(arr,low,m-1); quicksort(arr,m+1,high); } } int partition(int arr[],int low,int …

0
135
Member Avatar for inspire_all

i am trying to overload +operator to concat 2 strings i tried to write a code but it is giving 2 errors and i am also not sure whether logic is correct..MY CODE is [CODE]#include<iostream.h> #include<conio.h> #include<string.h> class string { char *str; public: string() { cout<<"enter string"; cin>>str; } void …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for inspire_all

#include<stdio.h> #include<conio.h> int main() { char cyp[150],eng[26]; scanf("%s",eng); gets(cyp); getch(); return 0; } eng is accepted but only one letter is accepted for cyp.

Member Avatar for rory.starkweather.7
0
387
Member Avatar for inspire_all

suppose there are two strings str1 and str2. suppose i filled str1 with some characters.Now what i want to do is copying string str2 at some specified location in str1. How can i do it?

Member Avatar for naveen1993
0
212
Member Avatar for inspire_all

What do you mean by a critical section? A critical section is a piece of code of a process that accesses a shared resource that must not be accessed by more than 1 thread of execn. 1.a thread is smallest seq of programmed instrns and process is made of many …

Member Avatar for rubberman
0
231
Member Avatar for inspire_all

Please can anybody explain me the following things below:: 1.What is a hashmap 2.Its use 3.What do we do to avoid collisions....

Member Avatar for deceptikon
0
128
Member Avatar for inspire_all

Problem: input:square matrix of order n and a query which will denote the submatrix.(x1,y1,x2,y2) output:no of distinct elements in this submatrix. constraint:time limit=1 sec this is what i tried #include<stdio.h> //#include<conio.h> int main() { //clrscr(); int a[300][300],test[100000],count[10],m,n,c,j,p,q,r,s; long qu,re,i; scanf("%d",&n); for(i=0;i<n;i++) for(j=0;j<n;j++) scanf("%d",&a[i][j]); scanf("%ld",&qu); for(re=0;re<qu;re++) { c=0; for(i=0;i<10;i++) count[i]=0; scanf("%d …

0
80
Member Avatar for inspire_all

#include<stdio.h> #include<stdlib.h> //#define MAX 10001 void quicksort(long long[],int,int); int partition(long long[],int,int); void swap(long long[],int,int); int main() { int t,k,q,i,j,qi,c,p; long long *mot,*sat,*res; //printf("Enter no of test cases"); scanf("%d",&t); for(i=0;i<t;i++) { p=0; //printf("Enter no of chefs and no of queries"); scanf("\n%d %d",&k,&q); mot=(long long*)malloc(k*sizeof(long long)); sat=(long long*)malloc(k*sizeof(long long)); res=(long long*)malloc(k*k*sizeof(long long)); …

Member Avatar for deceptikon
0
202
Member Avatar for inspire_all

I know that NP problems can't be solved in polynomial time.But what do NP complete and NP hard problems mean?

Member Avatar for amina.bm
0
241
Member Avatar for inspire_all

Suppose i have an algorithm whose time is represented by th function T(n)=n^3+2n^2 So what does n mean?

Member Avatar for amina.bm
0
145
Member Avatar for inspire_all

We trace recursion using an **internal stack**.How can we relate this to an **activation record **?i.e I want to know the** relation** between an internal stack and an activation record.

Member Avatar for sepp2k
0
122
Member Avatar for inspire_all

I am not getting the difference between branch and bound and backtracking.I know what backtracking is but i am not able to figure out how does branch and bound actually work?

0
76
Member Avatar for inspire_all

Suppose i have a 4 queens problem then i know what state space tree means but i am not able to get what does** solution space** mean?Also what is** difference between brute force and backtracking technique**s.I know that in backtracking if you don't get to a state whose bounded function …

Member Avatar for inspire_all
0
216
Member Avatar for inspire_all

Consider the below statement if(i==2) The lexical analyzer reads the source program one character at a time.So if we divide the statement into characters it would divide if into i&f and it would say that i is an identifier.But it doesn't do this.So is there any look ahead mechanism which …

Member Avatar for inspire_all
0
180
Member Avatar for inspire_all
0
69
Member Avatar for inspire_all

[CODE] #include<iostream.h> #include<conio.h> #define NULL 0 class node { public: int dt; node *lt,*rt; node(int x) { dt=x; lt=rt=NULL; } }; class tree { public: node *create(); int height(node*); node *mirror(node *); }; node* tree::create() { int x; cout<<"enter data(-1 for no data)"; cin>>x; if(x==-1) return NULL; node *t=new node(x); …

Member Avatar for raptr_dflo
0
124
Member Avatar for inspire_all

i recently read that quick sort is most popular algorithm.it has a good efficiency but its not stable.can anyone plz explain me quicksort algorithm in short.i am not able to get it:?:

Member Avatar for inspire_all
0
159
Member Avatar for inspire_all

i am a bit confused.i am feeling that one should be expert at data structures rather than language.i am learning c++ this semester,learning oop and data structures.[COLOR="Red"]is data structures more important than language?[/COLOR]what can get u into a good company?

Member Avatar for WaltP
0
127
Member Avatar for Ich bin würdig
Member Avatar for inspire_all

[CODE]#include<iostream.h> #include<conio.h> struct marks { int a:3; int b:3; int c:2; }; int main() { clrscr(); marks m={2,12,5}; cout<<m.a<<m.b<<m.c; getch(); return(0); }[/CODE] o/p is 2-41 i got how 2 and 1 came but didnt get how -4 came. according to me it should have been binary for 12=1100 b can …

Member Avatar for MandrewP
0
121
Member Avatar for inspire_all

i am a c++ beginner and i did not get the concept of virtual functions in polymorphism i am not getting the following lines [QUOTE]virtual function has an important advantage over simple overloading .if a particular member function is not defined for any derived class but is called through derived …

Member Avatar for inspire_all
0
140
Member Avatar for inspire_all

i recently read that we can pass function to a function by using pointer to a function. i tried with an simple example.i defined sum function and passed it to average function so that it calculated average of return value from sum and 2 more nos.. rather than convenience point …

Member Avatar for rubberman
0
254
Member Avatar for jman2011

try this it works [CODE]#include<iostream.h> #include<conio.h> #include<string.h> class string { char *str; public: void input() { cout<<"\nenter the string"<<endl; cin>>str; } void display() { cout<<"\n"<<str; } int friend upper(string); }; int upper(string a) { int j=0; while((*a.str)!='\0') { if((*a.str)>=65&&(*a.str)<91) { j++; (a.str)++; } else (a.str)++; } return(j); } int main() …

Member Avatar for WaltP
0
195
Member Avatar for programmerb

until u show what progress u have made how can anyone help u it is like doing ur homework for free and it wont help u my friend

Member Avatar for inspire_all
0
116
Member Avatar for denethor

why not like this? [CODE]#include<iostream.h> #include<conio.h> void main() { char *a="sample"; cout>>a; getch(); }[/CODE]

Member Avatar for denethor
0
213
Member Avatar for inspire_all

i am a c++ beginnner nd i am not getting the point why class is defined before main()function i.e globally:-O

Member Avatar for Ancient Dragon
0
159

The End.