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
Favorite Tags
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
131
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
379
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
198
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
229
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
125
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
77
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
196
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
236
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
141
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
117
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
75
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
212
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
172
Member Avatar for inspire_all
0
68
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
118
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
156
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
124
Member Avatar for Ich bin würdig

Hi guys ! I've made a program that marks a seat taken X in an airplane .. So, here's what I've done.. it runs , but when i try to input other seat code, i.e., 1G, the no.2 in the grid becomes 88.. and I don't know how did that …

Member Avatar for zeroliken
0
116
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
118
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
136
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
251
Member Avatar for jman2011

Here is what i got. I need to count the Uppercase entered in a string. Can someone help me? Enter string: The Brown Fox #of Upper Case: 3 My Progress: #include<iostream> #include<string> usingnamespace std; int main() { char string[15]; cout<<"Enter string: "; cin.getline(string,15); . . . . } I need …

Member Avatar for WaltP
0
190
Member Avatar for programmerb

please someone help me in printing 2 outputs in c using for or while loops . i am a begineer and i need help fast please. 1st pattern : 0 111 22222 3333333 444444444 55555555555 upto 10 . 2nd pattern: ABCD EFGH IJKL MNOP QRST UVWX YZ PLEASE HELPP

Member Avatar for inspire_all
0
114
Member Avatar for denethor

Hello, I have this code: [CODE] #include <iostream> #include <string> void main() { std::string a = "Sample"; printf("%s", a); std::cin.get(); } [/CODE] and it prints some I think random letters. Where i made mistake? And how should i change the code to write "Sample"? Thanks for answers and sorry for …

Member Avatar for denethor
0
207
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
156