- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 5
- Posts with Downvotes
- 5
- Downvoting Members
- 4
48 Posted Topics
array.length in 2d array returns the number of rows you entred but if you want to get the number of coloum, you must specify at first which row you want to get the length of it Ex. int [][]array= { { 1, 9, 4, 3, 32 }, { 0, 2}, …
Hi all, i'm in last year in the university. and now i'm looking for an idea to my graduation project. i'm interested in web development and database. i wanna new idea. or any implemented idea but not implemented many times... i needa buy it after graduation. so please help if …
[CODE]#include <stdio.h> #include <iostream> #include <string.h> using namespace std; int main() { string str1; char* str; cout<<" enter your command "<<endl; cin>>str1; str=(char*)str1.c_str(); char* str2="exit"; int status; while(strcmp(str,str2)!=0){ // createChildProcess(str); cout<<str<<endl; cout<<str1<<endl; cout<<strlen(str)<<endl; cout<<" enter your command "<<endl; cin>>str; } return 0; } [/CODE] try to run this program and …
how can i detect all cycles in the graph? i tried to use DFS and back edges and this ddetect some loops in te graph but not all cycles.
how can i detect all cycles in the graph? i tried to use DFS and back edges and this ddetect some loops in te graph but not all cycles.
how can I convert a variable of type template to an integer??
I have an integer array and I want to fill it. [CODE] int* a=new int[7]; [/CODE] but I want to check at first if the element a[i] is set before or not. Ex. a[3]=2; a[3] has value but all elements in a hasn't have any value until now, How can …
How can I determine the order of B+ Tree ? Or it should be according to the number of total elements in the tree.
I have a problem when I declare template class inside another a template class. [CODE]#pragma once template<typename T> class D<T>;//error 1,2 template<typename T> class B { D* d; public: B(void){ } ~B(void){ } }; [/CODE] [CODE]#pragma once #include<iostream> using namespace std; template<typename T> class B<T>;// error 3 template<typename T> class …
I have been written 2 classes A,B. and I want class A to use class B and vice verse but I have a problem when I tried to get the content of the class like(*A) that's my code. [CODE]#pragma once #include<iostream> using namespace std; class B; class D { B* …
I want to declare template inside a class .h file [CODE]# include<stdio.h> # include<iostream> using namespace std; #pragma once template <typename T> class LeafNode { T records; LeafNode* next; int size; public: LeafNode(void); ~LeafNode(void); };[/CODE] .cpp file [CODE]#include "LeafNode.h" template <typename T> LeafNode::LeafNode(void) { } template <typename T> LeafNode::~LeafNode(void) { …
I want to sort array of int, strings or any data type. Therefore I decided to use comparable array as an input to my sort function. But I get an error when I using it. Comparable arr[]; the compiler says "comparable is undeclared identifier". I think I must include specific …
How can i get th execution time ?? I tried to use library <time.h> [CODE] clock_t tStart = clock(); //put here my code double executionTime=(clock() - tStart)/CLOCKS_PER_SEC; [/CODE] here the excution time always zero. so what's the error here??
is there a way to convert from pointer array to array I tried the following, but it doesn't work. [CODE] int[]a={1,2,3}; int* p; p=a; a=(*P);// doesn't work [/CODE]
Hi,All I'm now working in project to compress a files. And I used Huffman encoding to get new code for each character in the site. but now I can't complete my project. How can I use bitwise operation to put all those new codes into the compression file. and Also …
Hi all during my implementation to tree data structure, I make a method which combine two trees in one tree and called it attach. I declared 3 trees t1,t2,t3. and then called method attach which will create new tree and put t1 in right and t2 in left and then …
[CODE] list<int>* compare(){ list q; q.push_front(1); q.push_front(2); return &q; } [/CODE] this method returns a pointer to an empty list how can I do to return priority_queue contain 1,2.
I have an error in my project and I can't fix the problem [CODE] #pragma once class Node { int code; int count; Node* parent; Node* rightChild; Node* leftChild; public: Node(int c1,int c2); void setCode(int c); void setCounter(int c); void setRightChild(Node n); void setleftChild(Node n); void setParent(Node n); int getCode(); …
how can I declare linkedlist (the ready implemented linkedlist in c++)
[CODE] int main(){ // I have an error in the next line read_file("F:/2nd year_2/Data structure 2/books/lecture-26.pdf"); return 0; } string read_file(char* address){ string line; ifstream myfile (address); if (myfile.is_open()) { while ( myfile.good() ) { getline (myfile,line); cout << line << endl; } myfile.close(); } return NULL; }[/CODE] this program …
I'm working in a program which compress a file I decided to use the huffman algorithm to encode (the Bytes Or character) but huffman algorithm depends on the frequency of each letter and If I calculate the frequency for each letter, it will takes long time. so what should I …
what's thew benefits of dynamic loading in java? and How can I load a classes befopre run the program?
I want to insert an image from my hard disk into the application but unfourtantly my code doesn't work and I can't determine what causes that the image disapear.[CODE] import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.text.Text; import javafx.scene.text.Font; import javafx.scene.image.Image; import javafx.scene.image.ImageView; /** * @author city */ def image = Image …
Please,say which line causes error in your program
you should first determine what's the problem and then go to solve it. because your programming skill are very weak then your problem is you missing understanding of programming concepts. to solve this problem,you should revise all programming concepts and understood it very well. after that go to the data …
I run the code of the first program and it's run on my eclipse. in the second problem you should used a for loop until user enters all numbers and save this numbers in array of size N*2 and then calculate which you need.
Eclipse is the best,if you want to write the code of the Gui. Net Beans is the best, if you want to make the GUI using drag and drop only.
I need some one explain to me marker interface and give to me an example in java Thanks,
my program doesn't work correctly because this exception [CODE]while(count<sharedBetweenThreads.size()){ for (int i = 0; (i < ourThreads.length) && count < sharedBetweenThreads.size(); i++) { if (ourThreads[i].isAlive() == false) { ourThreads[i].start(); } }[/CODE] if the length of an array of threads(ourthreads) equal 2. the two threads start and then the program check …
at which value of responce code will be the site valid ?
I want to use the tree in java but I found tree Set, Tree map I want to know each of them would be used and if I add element to the root how can I add element to this element.
I know that multithreads in java allows me do multi tasks in the same time, but in the following code I'm not make a sense that the three threads done in the same time [CODE]public class myThreads { public static void main(String [] args) { System.out.println("Begin main Function"); mThread Thread_One …
pass by value means call a method which take parameters like that {max(1, 2, max);} we call a method max and it's taken a 3 parameter as an integer values. but please don't post your home work again. to learn programming you must try with your self at first .
as I read in javadoc resultset represents a table which contain database therefore I want to know if there are a general way to iterate this result set and return data of it. on other side the interface result set contain method getString(int coloumindex), how can I implement this method?
[CODE]import java.util.Scanner; class CalcAvg{ public static void main (String args[]){ Scanner s = new Scanner(System.in); int sum = 0; int avg = 0; int count=0; System.out.println("Enter a number: "); int num=s.nextInt(); if(num==0||num==1||num==2||nu.............. ..............||num==9) { count++; sum = sum+num; System.out.println("Enter a number: "); int num = s.nextInt(); } avg = sum/count; …
[CODE]for (i=0; i<=4; i++) { System.out.printf("Please enter value in slot " + i + ":"); // add this line int j=input.nextInt(); numbers.add(j); cnt++; }[/CODE] try this . the line int j=input.nextInt(); makes you to take input from user good luck
I recommened you to try with your self and then If you have a compilation error or any problem post it here
I have a problem when I make GUI using SWT. the ptoblem is I want to remove all component except one from the shell at specific event.but I'm not preffered to use setVisible(false) because the big numer of component which will remove . how can I do that?
I'm now studing Object Oriented programming course,and I want to do a gui and implement all rules of object oriented programming in it . so what's the best recommend language to do gui other wise library swing in java ??
what's the meaning of - abstract data type - heab and stack - preprocessor.
I want easy algorithm with minimum order to get the sub-rectangle with the largest sum in an array for example array as a input 0 -2 -7 0 9 2 -6 2 -4 1 -4 1 -1 8 0 -2 sub-rectangle 9 2 -4 1 -1 8 maximum sum of …
I want easy algorithm with minimum order to get the sub-rectangle with the largest sum in an array for example array as a input 0 -2 -7 0 9 2 -6 2 -4 1 -4 1 -1 8 0 -2 sub-rectangle 9 2 -4 1 -1 8 maximum sum of …
The End.
eman 22