3Nigma's utility site
Home · Articles · News CategoriesSeptember 09 2010 11:50:16
Navigation
Home
Articles
Forum
myBlog[Romanian]
FAQ
News Categories
Contact Me
Links
Search
eniMath - Challlenges
eni - SkyCams
eni - Stamps
Users Online
Guests Online: 2
No Members Online

Registered Members: 27
Newest Member: selba
Friendly links
SkullBox - IT Knowledge Realm
FAQ: Programming concepts
What is "Divide et impera"?
Divide et impera[latin form for "divide and conquer"] is programming technique that consists,as it's name says,in braking a problem into a set of smaller problems,each problem having the same resolving algorithm.
After the bigger problem is broken into smaller problems and they are resolved,using recursive actions,the final solution is constructed.

As a first observation,we can state that not all the programs are resolvable through this technique.In fact there is a small number of programs that can uses this technique to show it's principle[Quick Sort,Hanoi tower,The biggest surface problem,The biggest value from an array,etc]

Secondly,Divide et impera[DIE] uses as it's main solving engine the technique of recursive problem solving!

What is a "pointer"?
A computer program uses a memory range defined by the operating system. In this memory space the program's variables are stored.

A pointer is a variable that "points"[indicates] the location of another variable in the computer memory,but not it's value!

Pointers are important in a programming language because they allow the programmer to toggle with the address of variables and not with their value!
Another thing why pointers are so important is because they are used with the concept of "dynamic memory allocation".

What is a "struct"?
Struct-s are,simply put,a user defined type of data that represents a collection of variables organized in a compact region of memory[the struct].
A struct has a name,a list of embedded types of data and a declaration of variables that will use the struct.

Example of struct :
struct contact{ //declaring a struct and giving it a name
char lname[20],fname[20];int age; //strunct internal variable definitions
}personA,personB; //struct variable declaration

Although the name of the struct and the struct variable definition can be omitted,they can't be omitted at once!
Using only the struct name will allow the programer to define later on in the program struct variables as simple as declaring an "int": ;
Using only the struct variable definition will result in not beeing able to initialize other struct variable definition in the program[dinamically].

Accesing struct internal data:
personA.lname
personB.age

To acces the struct internal data we use the .[dot] operator. ..


What is "recursivity"?
Recursivity is an ability of the object to call upon itself for processing. So, program recursivity represents recursivity implemented in programming.
A function is recursive if,in the function, lies an instruction to call itself as a function.

Example:
void add_one(){
//other instructions
add_one();
}

Recursive programming techniques involves predictability of a the state of a recursive function at any given time.
This is important because,if not controled,the recursive technique could enter in an infinite loop.
So,the recursive function must have a brakeing condition.

Recursive programming is used in other programing techniques such as DIE[Divide et impera],backtracking, graph theory,etc.
The opposite of recursive programing is iterative programing.

What is "iteration"?
Iteration programing is the technique of programing in a "linear" fashion[using loops like: while,for,do-while,etc].

Iteration is the opposite of recursive programming and it has a grater degree of state-predictability.
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Shoutbox
You must login to post a message.

No messages have been posted.
Copyright "3Nigma's brain"© 2008