Java Programming
Java Programming
Anyone here a computer scientist?
I am doing a paper this semester on Java programming.
Got an assignment coming up on Binary Search Trees.
Anyone an expert? Feel free to discuss your thoughts on Java or BSTs in this thread!
I am doing a paper this semester on Java programming.
Got an assignment coming up on Binary Search Trees.
Anyone an expert? Feel free to discuss your thoughts on Java or BSTs in this thread!
- max
- Australofrenchbrityorkus
- Posts: 3751
- Joined: 24 Apr 2002 00:12
- Location: Bondi Beach, Australia
- Contact:
http://www.cs.mcgill.ca/~cs251/OldCourses/1997/topic9/
this should help
They have a java applet at the bottom too. With the source code.
this should help
They have a java applet at the bottom too. With the source code.
Maxime Boucoiran
French ConneXion
BFC
French ConneXion
BFC
- millenniumtree
- Multidex Master
- Posts: 274
- Joined: 09 Aug 2004 21:24
- Location: Stoughton, WI
- Contact:
Ooh, OOH!!
Java is my favorite language, by far.
Binary search trees are nifty. They are basically a way of arranging data in what looks like an upside down tree (with the root on top)
Basically at every branch of the tree, there is a high side and a low side. Everything that is connected to one side of the tree is higher than everything on the other side. This makes searching for a particular value very easy, because you only have to traverse through a small number of points to find the correct object in a tree of hundreds.
If you have any questions about Java, or any other programming langauge for that matter, I would be more than happy to answer them. :D
I've done programming in Basic, PHP, C/C++, Java, ASP, ASP.NET, C#
Java is my favorite language, by far.
Binary search trees are nifty. They are basically a way of arranging data in what looks like an upside down tree (with the root on top)
Basically at every branch of the tree, there is a high side and a low side. Everything that is connected to one side of the tree is higher than everything on the other side. This makes searching for a particular value very easy, because you only have to traverse through a small number of points to find the correct object in a tree of hundreds.
If you have any questions about Java, or any other programming langauge for that matter, I would be more than happy to answer them. :D
I've done programming in Basic, PHP, C/C++, Java, ASP, ASP.NET, C#
3 courses left and I am done my compsci undergrad
but working at RIM for the next little while so dont know when I will finish :p hopefully the fall or winter
thoughts on java:
great language for teaching programming, kids, compsci students just beginnings, scientists that dont wanna learn heavy coding ect
object oriented is great and very useful to learn, java provides a good plateform for leaning oo stuff
I like the debugging and how cross plateform it is, windows, linux, toasters, pdas ect...
great documentatin and support for the language
cons: slow, therefore not for some scientific uses or for a lot of commerical programs, SLOW = the biggest problem
thoughts on binary search trees
a tree is a tree (kinda), there are better trees for searching that are more efficient and faster but trees in general are very useful (ie huffman compression and jpgs!)
kinda of a hard question to answer because its so broad
more specific questions would be helpful
goodluck on the assigments
thoughts on java:
great language for teaching programming, kids, compsci students just beginnings, scientists that dont wanna learn heavy coding ect
object oriented is great and very useful to learn, java provides a good plateform for leaning oo stuff
I like the debugging and how cross plateform it is, windows, linux, toasters, pdas ect...
great documentatin and support for the language
cons: slow, therefore not for some scientific uses or for a lot of commerical programs, SLOW = the biggest problem
thoughts on binary search trees
a tree is a tree (kinda), there are better trees for searching that are more efficient and faster but trees in general are very useful (ie huffman compression and jpgs!)
kinda of a hard question to answer because its so broad
more specific questions would be helpful
goodluck on the assigments
Jon's FootBlog
MSN: [email protected]
"It was clean enough to be thin..." - Andrew W.
MSN: [email protected]
"It was clean enough to be thin..." - Andrew W.
-
comastalker
- BSOS Beast
- Posts: 373
- Joined: 02 Mar 2004 10:00
- Location: germany - leverkusen
- Contact:
well this is imo one of the ugliest things to do in java.
I like java, but I hate hidden pointers.
C++ is the best language to go, though I'm also able to help in JAVA, (Object-)Pascal, Delphi and OpenGL as well as math stuff.
A binary tree in c++ would somehow look like
in a binary search tree, the value hold in a right child is always higher than the current node and the value in the left child is less than the current node.
So to search for a value you do following
I like java, but I hate hidden pointers.
C++ is the best language to go, though I'm also able to help in JAVA, (Object-)Pascal, Delphi and OpenGL as well as math stuff.
A binary tree in c++ would somehow look like
Code: Select all
struct SNode
{
[vartype] data; // if you want to hold integers, go for int value or so...
SNode* leftChild;
SNode* rightChild;
}
// intialization :
SNode root;
root.value = 0;
root.leftChild = NULL;
root.rightChild = NULL;
// adding a child to the right branch of root.rightChild
root.rightChild->rightChild = new SNode;
root.rightChild->rightChild.value = x;
etc.....
// deleting is like :
delete root.rightChild->rightChild;
root.rightChild->rightChild = NULL;
So to search for a value you do following
Code: Select all
(- start with root)
- For the current node :
- if the value in the current node is the needed one
- return true
else
if needed value > current Value
if rightChild == NULL then // nothing found
else repeat everything with current->rightChild
else
if leftChild == NULL then // nothing found
else repeat everything with current->leftChild
-Richard Vock-
"And today the great Yertle, The Marvelous he,
Is King of the Mud. That is all he can see.
And the turtles, of course...all turtles are free
As turtles and, maybe, all creatures should be."
- Dr. Seuss
"And today the great Yertle, The Marvelous he,
Is King of the Mud. That is all he can see.
And the turtles, of course...all turtles are free
As turtles and, maybe, all creatures should be."
- Dr. Seuss
-
comastalker
- BSOS Beast
- Posts: 373
- Joined: 02 Mar 2004 10:00
- Location: germany - leverkusen
- Contact:
the cross platform thing is really nice but there is a lack of (for me, as a game programmer) really essential things :
- templates (well in 2.0 they shall be implemented)
- operator overloading (it's so damn useful)
- sscanf() best function ever....
- a good inline assembler (like in MSVisualStudio)
- templates (well in 2.0 they shall be implemented)
- operator overloading (it's so damn useful)
- sscanf() best function ever....
- a good inline assembler (like in MSVisualStudio)
-Richard Vock-
"And today the great Yertle, The Marvelous he,
Is King of the Mud. That is all he can see.
And the turtles, of course...all turtles are free
As turtles and, maybe, all creatures should be."
- Dr. Seuss
"And today the great Yertle, The Marvelous he,
Is King of the Mud. That is all he can see.
And the turtles, of course...all turtles are free
As turtles and, maybe, all creatures should be."
- Dr. Seuss
- travismontoya
- BSOS Beast
- Posts: 356
- Joined: 28 May 2005 21:00
I know this is a old thread but I had to post on this considering ive been programming for 3 years, I hate C++ even though its OOP its just ugly and Bleh even the writer himself said he hated it, C is the way to go, Its widely used by EVERY programmer that knows what hes doing I mean, all of the GNU based programmers majority are in C, Assembly is great to, and I dont even want to talk about java because its just to much shit there is no pros with it other then that its easy as cake....
Sorry I know this has nothing to do with the topic but just had to post
Sorry I know this has nothing to do with the topic but just had to post
- travismontoya
- BSOS Beast
- Posts: 356
- Joined: 28 May 2005 21:00
And crap sorry bout the double post but all these edits are turned off for some reason... I just wanted to say my experience with programming, I was a porter for freebsd and a archlinux tur user, I program in alot of languages including the following some are scripting...
C/C++, Java (hate it), ASM (x86), PHP/MYSQL, Python, Perl, ruby

C/C++, Java (hate it), ASM (x86), PHP/MYSQL, Python, Perl, ruby
-
comastalker
- BSOS Beast
- Posts: 373
- Joined: 02 Mar 2004 10:00
- Location: germany - leverkusen
- Contact: