I am reading data from three files and then i want to sort the records on some criteria
Each file has records in the following format
First Name Last Name Gender Color Date
This is the code which i have ... i can sort only on the first name using collections.sort ... how do i sort on other columns ... any help would be appreciated ...
what is plane sweep algorithm to compute all intersection points between the circles?
...
How can I get the max and min value of array without calling other method?
Public triangles{
for (Polygon p: triangles){
int [] x = p.xpoints;
int [] y = p.ypoints;
}
// I dont know how to get the max and min of array X and Y since both array are declared inside the loop.
}
...
First off, this is a "homework" question so vector libraries and string libraries are off limits. I'm trying to get to the basics of c++.
My intention with this code is to make and use an array of string arrays. A list of words in other words.
When I run this code I get a bunch of nonsense.
If there is a better way to make a list of w...
For a Data Structures project, I must find the shortest path between two words (like "cat" and "dog), changing only one letter at a time. We are given a Scrabble word list to use in finding our path. For example:
cat -> bat -> bet -> bot -> bog -> dog
I've solved the problem using a breadth first search, but am seeking something bette...
Question
How can I randomly generate one of two states, with the probability of 'red' being generated 10% of the time, and 'green' being generated 90% of the time?
Background
Every 2 second either a green or a red light will blink.
This sequence will continue for 5 minutes.
The total number of occurrences of a blinking light should...
Hey everyone,
I was wondering if it is possible to traverse a linked list like this:
currentNode = randomNode;//where randomNode may or may not = firstNode
prevNode = firstNode;
while(prevNode != currentNode
}
Is it possible to do this in C++ when I am trying to find the node before currentNode in a singly linked list?
I trying to...
I am trying to write a program that is given a maze and tries to find the way out. M is the entrance, E is the exit, 1s are walls, and 0s are pathways. It is supposed to find each path and put P in the path. It is supposed to find all available paths. Right now it finds part of a path.
Here is the code:
public class Maze
{
private...
For my computer science class, we need to write a program (in C++) that takes an input of characters and outputs the possible permutations of it according to the dial pad on a phone, leaving non-digit characters in place.
For example, inputing 2 outputs 2, A, B, C. Inputing 23 outputs 23, A3, B3, C3, 2D, 2E, 2F, AD, AE, AF, BD, BE, BF, ...
Why might a machine-dependent language be more appropriate for writing certain types of programs? What types of programs would be appropriate?
...
data Expr = Var Char | Tall Int | Sum Expr Expr | Mult Expr Expr | Neg Expr | Let Expr Expr Expr
deriving(Eq, Show)
parseExpr :: String -> (Expr, String)
parseExpr ('*':'(':s) = (Mult x y, s'')
where (x,',':s') = parseExpr s
(y,')':s'') = parseExpr s'
parseExpr ('+':'(':s) = (Sum x y, s'')
where (x,',':s') = par...
hey there can anybody help me in doing this project i m nt able to do it alone =(
The project is divided into phases
Phase 1 :
In this phase, you will develop your application layer of your network protocol stack. The application layer will provides some network services to your program like connect to a remote host, send data, and r...
I'm a beginner in python programming and on one of my assignments I am to use python to write a code that will say these lyrics.
This old man, he played one
He played knick-knack on my thumb
Knick-knack paddywhack, give your dog a bone
This old man came rolling home
This old man, he played two
He played knick-knack on my shoe
Knick-k...
Hi, I have a hw question which confuses me on what i have to do. The question is below:
The idea is to design a generic function called Modify_If that will take an input x (passed by reference), and two functors f1 and f2. The function Modify_If will use functor f1 to determine whether x obeys a certain condition. If it does, Modify_if...
Can someone show me how to build a finite state machine that shows modulus 4 in binary?
...
I have to write a program in Pascal which has to detect how many words on a text (input by the user) start with a certain letter. I can't use arrays, can you give me any hints as to where to start?
...
I have table named "Table X" which contains some names and their corresponding age, table may contains same names (i.e) names will occur repeatedly.
Table x:
name age
a 21
b 37
c 23
a 34
a 21
b 19
b 37
a 21
...o...
how to extract the frequency spectrum from a set of discrete data using fft
...
Hi,
Following on from this question, I have created a feature to upload an site template file as part of an automated build of a SharePoint site. However, while the feature deploys the .stp file correctly to the hive, and the solution appears in the CAS | Operations | Solution Management page, the site template does not appear in the s...
i m working in 'C' red hat
i m having problem in transfering the file from client to server i apperciate if sum1 helps me here
i m thinking of using sendto() in client where i can gve file path in arguments n recv() in server code n mention file path in the arrguments ny oder idea plz ?
...