This example to generate balanced binary search tree from an array. A binary tree is balanced if for each node it holds that the number of inner nodes in the left subtree and the number of inner nodes in the right subtree differ by at most 1.
This is to find lowest common ancestor node for two nodes in tree.
This is to find all possible paths starting from left top corner of matrix to right bottom corner But we have constrain on this. You can only move Right or bottom and we also have blocking, Here blocking means 0 and path means 1. You can move to particular right or bottom if we have… Read more
You can store, access and modify properties available in Velocity class. Velocity has its own default properties available at below path. “org/apache/velocity/runtime/defaults/velocity.properties”
In Apache velocity, There are three main ways to pass data from Java class to VM template. 1. Key and Value mapping 2. Key and Bean/POJO (Object) mapping 3. Key and Inner Map mapping
In velocity template you can import local file using include or you can import other template using parse. #include – Include content of file in template. template engine is not going to rendered included files. #parse – Include template in other template. template engine will rendered this file. Note : #include( “sample.txt”, $sampleFile ) you… Read more
Apache Velocity has if condition like all other programming language. Find below syntax of #if in velocity.
There are three types of comments you can write in Velocity Template.
This tutorial is about #set element in velocity template.
This tutorial is about #foreach loop in velocity. Velocity has #foreach element for looping. Please find below template for more details.