Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~3K People Reached
Favorite Tags
Member Avatar for sciprog22

Hello Members, I have a question regarding the worst case running time for Knuth Morris Pratt Algorithm for String Matching: Let's say the T = AAAAB and P = AB. In this case, the prefix table is: Cell# P Skip Distance 0 A 0 1 B 0 As I scan …

0
130
Member Avatar for sciprog22

Hello, I have a question about ascending order sorting using the Comparabe interface: When I add the keys of my Hash Map to a TreeSet object and implement the compareTo as below, I get descending order of sorting of names: public int compareTo (Accounts a) { return a.name.compareTo(this.name); } // …

Member Avatar for sciprog22
0
162
Member Avatar for sciprog22

Hello, Thank you for your time! I have a Hashmap that has keys of of type Account (custom class) and the values are strings. The Account class has the following private variables: 1) name (String type) 2) account number (String type) 3) balance (type double). Following are the files: public …

Member Avatar for sciprog22
0
217
Member Avatar for sciprog22

Hello, Thank you for your time! I am trying to understand the Quick Sort algorithm. I have some questions about the partition method. I found the following implementation online: import java.util.Scanner; public class QuickSorts { public static int partition(int a[], int left, int right, int size) { int pivot = …

Member Avatar for sciprog22
0
229
Member Avatar for sciprog22

Hello, Thank you for your time! I have an applet where I have two blocks moving: When the program starts: a)The first block is constantly moving with a time delay of 100 ms about the horizontal direction at the top end of the applet (x starts at 0 and is …

Member Avatar for sciprog22
0
157
Member Avatar for sciprog22

Hello, Thank you for reading my message! I have an applet, where I make two instances of the custom JPanel objects and I add them into two JFrames and display them. Both of these panels have a 10 x 10 grid of buttons and an event handler is added on …

Member Avatar for sciprog22
0
150
Member Avatar for sciprog22

Hello, Could you explain the output for the program below? Is the output specifying a reference of the Scanner object in RAM (I don't see any hex hash) or something else? Thank you! import java.util.Scanner; public class ScannerTest { public static void main(String args[]) { Scanner input = new Scanner(System.in); …

Member Avatar for sciprog22
0
176
Member Avatar for sciprog22

Hello, I am writng a simple networking program with a single server and multiple clients. I would like to send and receive objects between the clients and the server and hence I use the ObjectOutputStream/writeObject(Object) and ObjectInputStream/readObject() combination. First, my server program: import java.net.*; import java.io.*; import java.awt.*; import java.awt.event.*; …

Member Avatar for sciprog22
0
897
Member Avatar for sciprog22

Hello, I have two programs: a) Server.java : Using a JFileChooser, selects a file and then sends it to Client. b) Client. java: Displays the file. My problem: I am able to send a file from server to client only once. The ObjectOutputStream.writeObject() does not work after that. I later …

Member Avatar for sciprog22
0
423
Member Avatar for sciprog22

Hello, I have a Client/Server program where the Server sends a string with a time delay using a Timer object to the Client. The Client has a JFrame with a JTextArea for display. When I test the Client program, I ran into two issues: a) Nothing ever shows up on …

Member Avatar for sciprog22
0
428
Member Avatar for sciprog22

Hello, Thank you for the time! a) I have a Ball Object which implements the Runnable interface and traces the various positions of a ball. b) I then have a Ball_Bounce JPanel inside a JFrame which creates two instances of the Ball object and then paints them to the JPanel. …

Member Avatar for sciprog22
0
190
Member Avatar for sciprog22

Hello, I am testing the following applet on my webpage: import javax.swing.*; public class Hello extends JApplet { public void init() { JOptionPane.showMessageDialog (null, "Hello World"); } } My Hello.html file from BlueJ: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- This file automatically generated by BlueJ Java …

Member Avatar for sciprog22
0
138