Algorithms « Development « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » Development » Algorithms 
Computer science emphasizes two important topics: datastructures and algorithms. Those topics are important because the choices you make for a program's datastructures and algorithms affect that program's memory usage (for datastructures) and CPU time (for algorithms that interact with those datastructures). When choosing a datastructure or algorithm, you sometimes discover an inverse relationship between memory usage and CPU time: the less memory a datastructure uses, the more CPU time associated algorithms need to process the datastructure's data items, which are primitive type values or objects, via references. Also, the more memory a datastructure uses, the less CPU time associated algorithms need to process the data items—and faster algorithms result. This inverse relationship appears in Figure 1.

Placing a backslash prior to any alphabetic character that does not denote an escaped construct (e.g., \j). Such characters are reserved for future extensions to the regular-expression language.

Last month's column brought you into the computer science world of datastructures and algorithms by focusing on the array datastructure and associated algorithms. Developers view the array as a fundamental datastructure because it serves as the basis for more complex datastructures, such as stacks, queues, and trees. Developers also view the fundamental linked-list datastructure as a foundation for more complex datastructures.

The atomic variable classes are called atomic because they provide for fine-grained atomic updates of numbers and object references, but they are also atomic in the sense that they are the basic building blocks for nonblocking algorithms. Nonblocking algorithms have been the subject of much research and study for over 20 years but have only become possible in the Java language as of Java 5.0.

The problem of timing a control loop is provided by adding a real-time clock to the computer systems. The provision of real-time clock involves the addition of some hardware components and some software. A timer can be implemented using RTSJ (Real Time Specification for Java) API as shown in Listing 7.

Evolutionary computing techniques, such as genetic algorithms (GAs), attempt to simulate this biological process on the computer in order to solve difficult problems. Pioneered by John Holland [1] in the 1970s, GAs have yet to create a better eye or a bat that can sing. But programmers have employed them for such diverse tasks as optimizing networks, calculating neural network weights, maximizing mathematical functions, scheduling resources more efficiently, minimizing costs in architectural designs while still meeting design constraints, and designing proteins in the pursuit of new drugs.

[1] John Holland, Adaptation in Natural and Artificial Systems, University of Michigan Press, 1975. [2] David E. Goldberg, Genetic Algorithms in Search, Optimization, and Machine Learning, Addison-Wesley Pub Co., 1989. [3] Melanie Mitchell, An Introduction to Genetic Algorithms, MIT Press, 1998. [4] David Applegate, Robert Bixby, Vasek Chvatal, William Cook, "Solving Traveling Salesman Problems", Princeton University. [5] Cuthbert Daniel, Fred S. Wood, John Wayne Gorman, Fitting Equations to Data: Computer Analysis of Multifactor Data, John Wiley & Sons, 1999. [6] Niles Eldredge and Steven Jay Gould, "Punctuated equilibria: An alternative to phyletic gradualism", Models in Paleobiology, 1972.

Recommended Title Bundle of Algorithms in Java, Third Edition, Parts 1-5: Fundamentals, Data Structures, Sorting, Searching, and Graph Algorithms, 3rd Edition

w_w__w__.__ja___v___a__2s_.__c__o__m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.