Topic:Vector

Design an algorithm to create a linked list of all the nodes at each depth

Given a binary tree, we have to design an algorithm that will create a linked list of all the nodes at each depth or level. For example, if we have a tree with depth D, then there...

Count number of ways to reach the nth stair by climbing 1, 2 or 3 steps

A child is running up a staircase with n steps and can hop either 1 step, 2 steps, or 3 steps at a time. Implement a method to Count number of ways to reach the nth stair by climbing 1,...

A Complete guide to CPP STL (Standard Template Library)

CPP is one the most popular language for competitive programming and that is because of its speed and its Standard Template Library(STL). The CPP STL (Standard Template Library) is a powerful set of CPP template classes that provide classes...

Algorithm to create linked list of nodes at each depth in Binary tree

Here we are given a binary tree, and we have to design an algorithm from scratch, which will create a linked list of all nodes at each depth. Let's understand what this means with the following example. Ex-> ...

Check if given two strings are permutation of each other

Suppose we are given two lowercase string as an input and we have to check whether they are a permutation of each other i.e if one string can be generated by changing the position of characters of the other...

Representation of a Graph using Adjacency List and Adjacency Matrix

In computer science graph is a data structure consisting of vertices and edges. It is usually written as G(V, E) where V is a set of vertices and E is the set of all the edges. We have two ways...

Subscribe to our weekly newsletter

Join our community of 1000+ developers and stay updated with the fast moving world of computer science

We promsie, we won't spam
Even we hate spam as much as you hate them