Archive | Algorithm

[Tree] Some operations on a binary search tree

[qads] Binary search tree (CNPTK) is a binary tree in which each node, key lock button is greater consideration of all the nodes of the tree and left the smaller keys of all the nodes of the tree must. Here is an example of a binary search tree: The content structure elements to plant trees Add Browse tree Search Enter a node tree […]

The algorithm checks primes – Algorithm check prime number

Article mentioned the algorithm checks primes from simple to advanced, written in the minds of readers from the simple to the optimization step algorithm. Demo code written in C language

[Algorithm – C / C ] Quick Sort – The issues

First we explore the idea of ​​the algorithm Ideas: Quicksort array divided into two lists by comparing each element of the list with a selected element is called key element. These elements less than or equal key element to be taken forward and in the first list, the larger particles are put on the rear latch […]

Answers Student Computing OLP ICTU 2017

HINTS solution OLP EXAM STUDENTS NEWS ICTU 2017 Here's Threads, guide the, explanation of exam. The code is written in C language, other languages ​​do the same. All posts are entered using the standard output (typing, output to the screen). Download PDF File Last 1: Revenue (50 point) Threads: The turnover of Runtime: 1 cause points: […]

[Algorithm – Java] Jump infix expression to postfix – Java – converts infix to postfix

The algebraic expressions are used daily are expressed as central elements (infix). This demonstration is understandable to humans because most operators (+, -, *, /) are binary operators and their division between the two operands together. However for PC, to calculate the value of an algebraic expression of this form […]

[C / C ] Calculate the number of large

To handle a large number of us will turn to handle string. In the following code method was needed your attention str.insert(int post, int n, int ch); n times to insert the character ch in the string str at position pos; There are also 2 Other methods are : str.insert(int post, char * s); insert s (array of characters ending '') at position pos of str; str.insert(int post, string […]

Tiled 2 * n

Threads: http://vn.spoj.com/problems/LATGACH/ First we consider a rectangular 2×1 there 1 placing it ranked 1 brick 2×1. At the rectangular 2×2 there 2 placing it ranked 2 1 member×2 or 2 2 members×1. At the rectangular 2xi have the following cases with f(in) the placing of the rectangle 2xi. => f(in) = f(i-1) + f(i-2) with f(1) = 1 and […]

[Java – Algorithm] Simulation Dijkstra's algorithm to find the shortest path

About algorithm, You can view the article in Search Dijkstra shortest path, Floyd. This article I will introduce you to the simulation program Dijkstra's algorithm with graphics on Java, This is also the subject of their practice facility. Update Date 23/05/2015: Fix icon on windows loaded. The program allows users to graph a quick and […]

Library expression algorithmically calculated Balan

His library built on java platform to serve the calculated value of complex expressions. One of the main functions of the library include: Update 09/10/2014: version 1.1: Fix & catch some errors, notified when non-standard operations. isNumber(String s) : returns true if s is the number, otherwise it returns false ISNUMBER(char c): returns true if s is the number, reverse […]

[Binary Tree] Jump binary tree into a binary search tree

How do my very simple. We simply browse to save the elements of the original binary tree into the array, and finally insert the values ​​of the array into trees by inserting 1 Binary Tree Node on ferry. That was 1 binary search tree. Code: