Arnab Chakraborty has Published 4293 Articles

Construct a Maximum Sum Linked List out of two Sorted Linked Lists having some Common nodes in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 14:25:51

267 Views

Suppose we have two sorted linked lists, we have to make a linked list that consists of largest sum path from start node to end node. The final list may consist of nodes from both input lists.When we are creating the result list, we may switch to the other input ... Read More

Construct a linked list from 2D matrix in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 14:20:57

1K+ Views

Suppose we have one matrix, we have to convert it to 2d linked list using recursive approach.The list will have the right and down pointer.So, if the input is like102030405060708090then the output will beTo solve this, we will follow these steps −Define a function make_2d_list(), this will take matrix mat, ... Read More

Construct a linked list from 2D matrix (Iterative Approach) in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 14:18:10

218 Views

Suppose we have one matrix, we have to convert it to 2d linked list using iterative approach. The list will have the right and down pointer.So, if the input is like102030405060708090then the output will beTo solve this, we will follow these steps −real_head := NULLDefine an array head_arr of size: ... Read More

Construct a distinct elements array with given size, sum and element upper bound in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 14:14:11

182 Views

Suppose we have one size variable N, we also have one variable SUM this is the total sum of all elements available in the array and another variable K such that there is no element in array is greater than K, We have to find one orthogonal array where all ... Read More

Construct a DataFrame in Pandas using string data in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 14:11:58

650 Views

Here we will see how we can construct a pandas dataframe using string type data. Pandas supports csv files, but we can do the same using string also. For string type data, we have to use one wrapper, that helps to simulate as the data is taken as csv reader.Here ... Read More

Construct a BST from given postorder traversal using Stack in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 14:10:31

258 Views

Suppose we have one postorder traversal of a binary search tree; we have to find the binary search tree from it.So, if the input is like [6, 12, 10, 55, 45, 15], then the output willTo solve this, we will follow these steps −Define a function solve() . This will ... Read More

Construct a Binary Tree from Postorder and Inorder in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 14:07:33

655 Views

Suppose we have the inorder and postorder traversal sequence of a binary tree. We have to generate the tree from these sequences. So if the postorder and inorder sequences are [9, 15, 7, 20, 3] and [9, 3, 15, 20, 7], then the tree will be −Let us see the ... Read More

Construct a Binary Search Tree from given postorder in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 14:04:34

294 Views

Suppose we have the postorder traversal sequence of a binary search tree. We have to generate the tree from these sequences. So, if the postorder sequences is [9, 15, 7, 20, 3], then the tree will be −To form a tree we need inorder traversal also, but for binary search ... Read More

User Defined Literals in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 14:00:41

370 Views

Here we will see the concept of the user-defined literals in C++. From C++ version 11, the User Defined Literals (UDL) are added in C++. C++ also provides literals for a variety of built-in types but these are limited.Built-in Literals −31 (Integer)3.5 (Double)4.2F (Float)'p' (Character)31ULL (Unsigned Long Long)0xD0 (Unsigned Hexadecimal ... Read More

Uniform Initialization in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 13:55:32

1K+ Views

Here we will discuss about the uniform initialization in C++. This is supported from C++11 version. The uniform initialization is a feature that permits the usage of a consistent syntax to initialize variables and objects which are ranging from primitive type to aggregates. In other words, it introduces brace-initialization that ... Read More

Advertisements