EnglishFrenchGermanSpainItalianDutchPortugueseRussianKoreanJapaneseArabic Chinese Simplified
Showing posts with label Algoritma dan Pemrograman. Show all posts
Showing posts with label Algoritma dan Pemrograman. Show all posts

Wednesday, June 29, 2011

Class Inheritance

Using the foo class from the previous tutorial as a base class, we are going to introduce a new class called fooed that inherits from foo. Here are the two classes without any methods.

Tuesday, June 28, 2011

OOP Recursive Decent Parsing III

we are going to use the Production class as the base class for each one of our productions. Polymorphism with the Production class will come in shortly. Now the most basic production we have here is number. It’s a terminal production and can be implemented quite easily.

Sunday, June 26, 2011

OOP Recursive Decent Parsing II

#include <istream>
#include <deque>
#include <locale>

#include "Parser.h"

/**
* static functions
*/

Monday, June 20, 2011

OOP Recursive Decent Parsing I

First off we need to define what our parser is going to do; we need to a construct a set of terminals and non-terminals to work with, in other words a “grammar.” Let’s look at the following grammar.

Wednesday, May 25, 2011

Calculate Sequebce by Using Iterative Function

Jeliot Program to calculate the Sequence by using the Iterative Function
import jeliot.io.*;

public class hitung {
 
    public void input(){
    System.out.println("tentukan nilai n:");
    n=Input.readInt();
    }

Monday, May 23, 2011

A Comparison of Sorting Algorithms

Recently, I have translated a variety of sorting routines into Visual Basic and compared their performance...  I hope you will find the code for these sorts useful and interesting.

Wednesday, May 18, 2011

Typical data sequences for testing sorting algorithms

There is not "best sorting algorithm" for all data. Various algorithms have their own strength and weaknesses. For example some "sense" already sorted or "almost sorted" data sequences and perform faster on such sets.  In this sense Knuth math analysis is insufficient althouth "worst time" estimates are useful.

Sunday, May 15, 2011

Quicksort Algorithm

Having struggled to follow the recursive calls to quicksort and partition I have modified the code to include the calls to both functions, displaying the order in which the array is in at each stage.

Monday, May 2, 2011

Vector

class template
<vector>
Vector
Vectors are a kind of sequence container. As such, their elements are ordered following a strict linear sequence. Vector containers are implemented as dynamic arrays; Just as regular arrays, vector containers have their elements stored in contiguous storage locations, which means that their elements can be accessed not only using iterators but also using offsets on regular pointers to elements.

Sunday, April 24, 2011

Function to reverse an integer array

This function(ReverseArray is used to reverse an integer array. For example, if the
array is {1,2,3,4,5}, these functions will return an array like {5,4,3,2,1}.
The user needs to pass in a pointer to the array and the size of the array,
and the function will return a pointer to an array in the reverse order. 

Array

The array keyword lets you create a dynamic array that is allocated on the common language runtime heap.

[qualifiers] [cli::]array<[qualifiers]type1[, dimension]>^ var = 
gcnew [cli::]array<type2[, dimension]>(val[,val...])

Saturday, April 23, 2011

String Contains function

The strContains function returns true or false depending on whether the input string contains the search string. If you have ever used the contains function in C# or VB then you may know how useful it can be.

Monday, April 18, 2011

RECCURENCE RELATION

use the iteration scheme for a SERIES of ISSUES the formula can be expressed in relationship/recurring relationship, which concerns the issue of accuracy of the representation of numbers on a computer.
Example :

Saturday, April 16, 2011

Recursion

Recursion is a programming technique that allows the programmer to express operations in terms of themselves. In C++, this takes the form of a function that calls itself. A useful way to think of recursive functions is to imagine them as a process being performed where one of the instructions is to "repeat the process". This makes it sound very similar to a loop because it repeats the same code, and in some ways it is similar to looping.

Recursion Shortest Function to Reverse a String

/*
Recursive Reverse String Algorithm

The Shortest function to reverse a string.


*/

Calculator (C++)

This code (program) allows you to choose what calculations you want. Like Addition and Multiplication. It uses the switch statement. this is only a very simple calculator and can only calculate two numbers at a time. Now it uses a loop and quits when you want it to.

Recursive Format numbers with commas

 You may also like to use the enclosed snippet that demo's a way to validate if a C++ string represents an integer.

// validates string 's' passed in and extracts a front sign (if there) into char var 'sign'
bool isInt( string& s, char& sign ); // Note: string without a 'sign' is returned

Calling functions with Inline Assembly

Compiles under Visual C++ 2008 as a console application and should compile with Visual C++ 2005

Friday, April 15, 2011

Recursive Function

A recursive function is a function that calls itself. This function will continue to run until the stop condition is met, therefore in a recursive function needs to be there are 2 important blocks, namely block that became the point stop from a process of recursion and the block that is calling itself.

Sunday, April 10, 2011

Algoritma Menentukan Tahun Kabisat

Tahun Kabisat adalah :
- Tahun yang habis dibagi 4
- Jika tahun habis dibagi 100, maka Tahun tersebut juga harus habis dibagi 400

 

Copyright © 2009 by Learn Technology

Template by Blogger Templates | Powered by Blogger