Print All Root to Leaf Paths with Their Relative Positions in C++

sudhir sharma
Updated on 17-Jan-2020 11:07:39

161 Views

In this problem, we are given a binary tree. And we have to print all the paths from the root to the leaf of the tree. Also, add underscore “_” to show the relative positions of the nodes.Let’s take an example to understand the topic better −Input −Output −_ _ 3 _ 9 1 _3 9 _7 3 _ 4 _ _ 2 3 9 4 1 7 6 2 3 _ 4 6To solve this problem, we will use the concept of the vertical order of the elements of the tree.Based on this, we will print the path from ... Read More

Top 10 Chrome Extensions for Work

karthikeya Boyini
Updated on 17-Jan-2020 11:07:20

456 Views

Google Chrome is one of the most loved browser in today’s IT world. It is fast, reliable, secure and simple. Along comes the huge list of extensions. The extensions are tiny programs, running in the background, which helps in modifying and enhancing the features and functionalities of Chrome browser. Here are the top 10 extensions of Chrome that can really help in improving your productivity at work.Copy All URLsThis is a very useful extension for those who often works on multiple tabs. While working on multiple site if you want to copy multiple URLs, then this extension comes in handy. ... Read More

Add Debugging Code to JavaScript

Krantik Chavan
Updated on 17-Jan-2020 11:06:09

217 Views

To add debugging code to JavaScript, use the alert() or document.write() methods in your program. For example,var debugging = true; var whichImage = "widget"; if( debugging ) alert( "Calls swapImage() with argument: " + whichImage ); var swapStatus = swapImage( whichImage ); if( debugging ) alert( "Exits swapImage() with swapStatus=" + swapStatus );Examine the content and order of the alert() as they appear, you can examine the health of your program very easily.

Rolltop: A Laptop You Can Roll

Samual Sam
Updated on 17-Jan-2020 11:05:03

6K+ Views

When the German company, Orkin Design had conceptualized the Rolltop in 2009, a laptop that will come with a screen so flexible that it can actually be rolled into a sort of scroll, it had caught the attention (and imagination) of the entire world. The tech company said that it will use flexible OLED and touchscreen technologies to create a cylinder-shaped laptop. The lower part of the screen is used as a keyboard while the upper part becomes a 13-inch display. It can also be rolled into a tablet, or expanded to a full 17-inch monitor with a pull-out support ... Read More

Print All Safe Primes Below N in C++

sudhir sharma
Updated on 17-Jan-2020 11:04:32

151 Views

In this problem, we are given an integer N and we have to print all safe prime number whose values are less than N.A safe prime number is a prime number which can be represented as [(2*p)- 1] where p is also a prime number.Examples − 5[(2*2) +1] , 7[(2*3)+1].Let’s take a few examples to understand the problem better −Input: N = 12 Output: 5 7 11.To solve this problem, we will find all the prime numbers less than N(for this we will use Sieve of Eratosthenes). And check if the prime number is a safe prime number or not ... Read More

Top 5 Best Linux Text Editors

karthikeya Boyini
Updated on 17-Jan-2020 11:03:04

1K+ Views

A text editor is a kind of program used for modifying simple text records. Such packages are repeatedly often called “notepad” application, following the Microsoft Notepad. This article explains about -“Top 5 Best Linux Text Editors”Vi EditorVim is a pre-set up text editor that’s upwards suitable to Vi. It may be used to edit all sorts of plain textual content. It is exceptionally priceless for enhancing packages.To open Vi editor, use the following command –$viThe sample output should be like thisTo get the more infomation about Vi editor, use the following command –$ vi --helpThe sample output should be like ... Read More

Print All Sequences of Given Length in C++

sudhir sharma
Updated on 17-Jan-2020 11:02:28

771 Views

In this problem, we are given two integer values, k, and n. And we have to print all the sequences of length k from numbers from 1 to n in sorted order.Let’s take an example to understand the topic −Input:k = 2 ; n = 3 Output: 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3So in this problem, we have to print the sequence as stated above.A simple way to solve this problem is by incrementing integers of the sequence till they get to the max value i.e. n. The ... Read More

Role of IT Professional as a Strategic Resource

Samual Sam
Updated on 17-Jan-2020 11:01:34

162 Views

Many industry experts opine that the mark of any business is to keep itself abreast with information technology breakthroughs. It is the age of technology, which can seldom be relevant when your business is no longer integrated with IT and vice versa. Business and IT strategies have become more relevant than ever before and hence, all the evaluation frameworks that verify fundamental rethinking and redesigning of critical and contemporary industry best practices should be properly aligned. The role of IT as a strategic resource calls for technology-centric overhauling of the established and accepted organizational processes. In essence, even the great ... Read More

Print All Sequences Starting with n and Consecutive Difference Limited to k in C++

sudhir sharma
Updated on 17-Jan-2020 11:01:29

131 Views

In this problem, we are given three variables n, s, and k and we have to print all the possible sequences that start with the number n and length s having the absolute difference between consecutive elements less than k.Let’s take an example to understand the topic better −Input: n = 3, s = 3 , k = 2 Output: 3 3 3 3 3 4 3 3 2 3 4 4 3 4 5 3 4 3 3 2 2 3 2 3 3 2 1In this problem, we need to obtain the absolute difference less k. For this, ... Read More

Print All Semi-Prime Numbers Less Than or Equal to N in C++

sudhir sharma
Updated on 17-Jan-2020 11:01:15

545 Views

In this problem, we are given an integer N. and we have to print all the semiprime numbers that are less than or equal to N.Before solving this problem, let’s understand what is a semi-prime number.A semi-prime number is a number whose value is the product of two distinct prime numbers.Let’s take an example, 21 = 3*7 is a semiprime number.25 = 5*5 is not a semiprime number.Now, let’s take an example of semiprime numbers less than or equal to n.Input: N = 15 Output: 6 10 14 15To solve this problem, we have to take each number less than ... Read More

Advertisements