Skip to content
  • Home
  • Algorithms
  • DS
  • Salesforce
  • Courses
    • C Programming
    • Data Structures with C/C++
    • Algorithms and Interview questions
    • ACCOUNTS
      • TALLY ERP9 Course Structure
  • Submit your article
Search
Close

Tag: Interview Questions

Unlocking Maximum Palindromic Length With Powerful Recursion And Dynamic Programming

GalleryJune 9, 2020January 20, 2023 KodeBinary

A substring is a sequence of characters which has been extracted from a larger string. For example, let’s consider the string “Hello World”. We can form the substring “Hello” by selecting the first five characters of the string. Let’s see the following another example. In order to calculate the length of a substring, we needRead More »

Counting Subsets with Sum in Unsorted Array

GalleryJune 3, 2020January 20, 2023 KodeBinary

We are aiming to find the total number of subsets with a given sum in an array of unsorted integers of size ‘N.’ For example, given an array {1, 2, 3, 4} and a sum of 6, the subsets with sum 6 are {1, 2, 3} and {2, 4}, making the count of subsets 2.Read More »

Topological sort of an acyclic directed graph

GalleryMay 23, 2020May 23, 2020 KodeBinary

Topological sorting forms with the ordering of all its vertices topologically. A topological ordering of any edge “U–>V” in an acyclic directed graph starts with “U” then “V”. For example we can think of any processes dependency in which task ‘U’ needs to finish first to execute process ‘V’. We cannot do topological sorting onRead More »

Best complexity edit distance algorithm with an example

GalleryMay 22, 2020May 23, 2020 KodeBinary

Edit distance The minimum number of operations on a string (array of characters) to convert into another input string is called the edit distance between the two strings. The operations can be Insert a character, Remove a character, or Replace a character with another. We can solve this problem using recursion. Now let’s take aRead More »

K-th largest or smallest element in an unsorted array of integers

GalleryMay 22, 2020May 22, 2020 KodeBinary

Given an input of ‘N’ unsorted integers in which we need to find the given K-th largest or smallest integer. This is one of the most commonly asked interview questions asking in recent days. As there are multiple ways to solve this problem, in this article I am discussing two optimized solutions for this problem.Read More »

Find the maximum subarray sum in an unsorted integer array

GalleryMay 20, 2020May 31, 2020 KodeBinary

Given an array of unsorted integers with both negative and positive values. We aim to find a subarray in which the sum of all integers is maximum than any other subarray of the given array. Let’s understand this with the below example image. The above input array has integers of size 7 and its maximumRead More »

Find the median of an unsorted stream of integers at any given time

GalleryMay 19, 2020May 19, 2020 KodeBinary

An unsorted integer stream is coming, we need to always keep the median of all the stream elements. The median can be defined as follows. To find the median of any given array, Sort the array Find integer(s) in the middle of the sorted array The average of middle these integers is median ( IfRead More »

Reverse alternate group of K nodes in a singly linked list

GalleryMay 18, 2020May 18, 2020 KodeBinary

Consider we have a singly linked list of “N” nodes, in which we aim to reverse alternate “K” nodes. Let’s see the below pictorial representation of a singly linked list. Here, our input linked list of size 7 nodes is 10->20->30->40->50->60->70->NULL and we want to reverse every alternative 3 (K) nodes group, pictorial representation ofRead More »

Find root to leaf path whose sum is maximum in a binary tree

GalleryApril 27, 2019May 16, 2020 KodeBinary

Given a binary tree with all positive integer nodes, we need to find the path from the root to a leaf whose sum is maximum in all root to leaf paths of the binary tree. The above diagram shows a simple binary tree with the maximum sum path [24, 16, 12]. This algorithm needs anRead More »

Print binary tree nodes in vertical order (vertical order traversal)

GalleryApril 24, 2019August 13, 2020 KodeBinary

A vertical order traversal is one of the binary tree traversals, where all elements are vertically at the same level, displays as an array of elements. If someone looks at a 3D model of the binary tree from bottom to top way, all the rear nodes which are hidden by front nodes, come under theRead More »

Find verticals sum of binary tree

GalleryApril 23, 2019May 16, 2020 KodeBinary

Given a binary tree with integer nodes in it, the aim is to find verticals sum. Let’s discuss this with the below example. As shown in the image above, each vertical level has an index, like {-2, -1, 0, 1, 2} in the above picture. The result should be the sum of all the nodesRead More »

Lowest common ancestor

GalleryApril 23, 2019May 16, 2020 KodeBinary

Given a binary tree and two integer nodes on it, the aim is to find the lowest common ancestor of the nodes in a given binary tree. A lowest common ancestor is the lowest common parent node of the respective nodes. Let’s check this with a couple of examples. We can solve this problem recursively,Read More »

Find mirror of a binary tree

GalleryApril 21, 2019May 16, 2020 KodeBinary

Given a binary tree, we aim to find its mirror tree. A Mirror tree is a binary tree where it’s left and right subtrees are swaps its positions. A recursive definition of the mirror tree is a binary tree T(P, L, R) is T(P, T(R), T(L)). Here both L(left) and R(right) subtrees swapped their positionRead More »

Find the diameter of a given binary tree

GalleryApril 20, 2019May 16, 2020 KodeBinary

The diameter of a binary tree is the longest distance between two leaf nodes. These leaf nodes are nodes from the root node or leaf nodes of any subtrees’ of the binary tree. Let’s see below two example binary trees diameter At any specific node it calculates as the sum of heights of left childRead More »

Convert binary tree to its sum tree in-place

GalleryApril 20, 2019May 16, 2020 KodeBinary

A binary tree with integer nodes is given, we aim to convert this binary tree to its sum tree in-place. A Sum Tree is a binary tree in which the value of the current node is a sum of data of all its descendent nodes data. Let’s see below the binary tree and its sumRead More »

Posts navigation

Older Posts

Subscribe to KodeBinary

Enter your email address to subscribe KodeBinary and receive notifications of new posts by email.

Join 1,773 other subscribers

Recent Posts

  • Find the sum of the largest increasing branch in an n-ary tree
  • The fizzbuzz program in python
  • Python program to add two numbers
  • Program to find factorial of a number in python
  • Armstrong number in python

Our Partners

Home, Car Loan EMI Calculator

Categories

  • accounts
  • Algorithms
  • autoCAD
  • C
  • C++
  • COVID 19
  • DS
  • HTML
  • Java
  • ms office
  • Python
  • Salesforce
  • TALLY
  • Tally Prime
  • Uncategorized

Tags

Accounts Algorithms Amazon Ancillary Rules Arrays assignment bill of materials Binary Search Tree C++ company contra voucher cost categories cost centers C Programming DataStructures debit Dynamic Programming Graphs GROUPS groups and ledgers gst Interview Questions INVENTORY ledgers Linked List Microsoft payment voucher Purchase Python Queue Quiz receipt voucher Recursion sales Sorting Stack STOCK ITEMS Strings tally tallyerp9 tally prime TALLY WITH GST Trees Voucher vouchers

Follow Us

  • Facebook
  • Tumblr
  • Instagram
  • LinkedIn
  • Twitter
Copyrights 2019 | KodeBinary.com.
Back to top