Binary Tree Important Definition and Properties.

 Binary Tree


Tree: Non-Linear Data Structure in which data is organized in a hierarchical manner.  It is very fast for information retrieval and searching operations. 


Important Terminology of a Binary Tree.


Node: Each element in a tree is called a node.

Edges: Lines connecting two nodes, it is also known as branches. 

Parent Node: The immediate predecessor of a node (node that comes just before a node).

Child Node: The immediate successors of a node (node that comes just next in line).

Root Node: The node that doesn't have any parent node.

Leaf Node: The node that doesn't have any child node. The node other than the leaf node is known as a non-leaf or terminal node. 

Level: Distance of that node from the root.

Height: Total number of level, depth of the tree, Level+1=Height

Siblings: All nodes having the same parent. All siblings are at the same level but it is not necessary that nodes at the same level are siblings.

Path: It is a way to reach a node from any other node. In a tree, there is only one path possible between any two nodes. Path length = Number of Edges on the path.

Degree: The number of children or subtrees connected to a node.

Forest: The subtrees we get after removing the root of the main tree is collectively called as Forest (also known as a set of disjoint trees).  

Strictly Binary Tree: Each node in the tree is either a leaf node or has exactly two children. There is no node with one child. 

Extended Binary tree: Each Empty subtree is replaced by a special node then the resulting tree is extended binary tree or 2-tree.

Full Binary tree: All the levels have the maximum number of nodes.

**If the number of any node is k, then the number of the left child is 2k, the number of right children is 2k+1, and the number of its parent is k/2.

Complete Binary Tree: All the levels have the maximum number of nodes except possibly the last node.


Important Properties of a Binary Tree.

P1. The maximum number of nodes possible on any level i is 2^i where i>=0.

P2. The maximum number of nodes possible in a binary tree of height h is 2^h-1.

P3. The minimum number of nodes possible in a binary tree of height h is equal to h. A tree with a minimum number of nodes is called skew trees.

P4. If a binary tree contains n nodes, then its maximum height possible is n and the minimum height possible is log2(n+1).

P5. In a non-empty binary tree, if n is the total number of nodes and e is the total number of edges, then e = n-1.


P6. In a non-empty binary tree, if n is the number of nodes with no child and m is the number of nodes with 2 children, then n = m+1.

Traversal in Binary Tree
1. Breadth-First Traversal (Level Order Traversal)
2. Depth First Traversal
APreorder Traversal (Root, Left, Right)
BInorder Traversal (Left, Root, Right)
CPostorder Traversal (Left, Right, Root)

Edit your videos for free using VLC media player.

Edit using VLC Media Player

 

VLC is usually thought of as a media player and a very good one at that. However, there’s more to the software than meets the eye. Did you know you can use it to make simple edits to your videos as well as just watch them? This saves you needing to download a separate video-editing tool if you’re short on space or don’t use one often enough to justify the installation.

 

Trim a video clip using a VLC media player.

 

#Step 1:

First, we’ll look at how to trim video, so you can remove unwanted sections to create a clip. To do this, you need some extra tools. Open the View menu and choose Advanced Controls. This adds a Record button and a useful ‘Frame by frame’ button.

 

Video Trim using VLC

#Step 2:

Load the video and watch it through to make sure you’re familiar with where you want to start and endpoints to be. Use the slider to get the video near and immediately press the Record button when you get to the correct place.

 

trim video step 2

#Step 3:

You have to mark the end of your clip manually. When the video gets to the stop point, click the Record button again. The trimmed video file is saved to your Videos folder with ‘vlc_record’ at the front of its name. Do this as many times as required to collect the clips that you need.

 

Stick video clips together using a VLC media player.

While VLC is perfectly capable of sticking video clips together, the option was removed from the latest version of the graphical interface. However, the action can still be performed from the Command Prompt. Start by renaming the files you want to stitch together-use a simple, consecutive system, such as numbering them.

 

#Step 1:

Close any instances of VLC that you have open. Enter cmd in the search box to launch the Command Prompt, and navigate to the folder that contains your renamed video files. In our case, we used cd c:\Users\Praveen Kumar\Videos.

 

#Step 2:

Next, type a command with the path to the vlc.exe file, the names of all the files you want to join, and a couple of additional commands including the name of the final file. Our was “C:\Program Files\VideoLAN\VLC\vlc.exe” 1.mp4 2.mp4 --sout “#gather:std{access=file,dst=join.mp4}” --sout-keep

 

#Step 3:

VLC opens and joins the files together. The process is carried out discreetly, so you won’t see anything appear on the screen. You now have to shut VLC down again before the new file (in our case, called ‘join’) is properly finished. If you look at it before closing VLC, it will appear to be an empty file.

 

#Step 4:

The file’s thumbnail appears. You can reopen VLC and play the video as normal. If you want to watch any changes to the file, such as adding more clips, make sure you rename the output file in Step 2, so it doesn’t overwrite your existing file.

 

#Step 5:

You may feel your video is a bit boring and decide to spice it up with a few video effects. If you do this as you record your clips above, you can insert them into your finished product. Click the ‘Show extended settings’ button and click the Video Effects tab.

 

#Step 6:

There are plenty of effects to experiment with, such as changing the color of your video from the Colors tab. Here, we’ve chosen a Sepia tint. The Essential tab has subtler color changes, Geometry lets you rotate the video and Overlay can insert a logo or text.  

DON'T MISS

Nature, Health, Fitness
© all rights reserved
made with by templateszoo