Articles for author: Abhinav Kaushik

Maximum Subarray Sum

Problem Statement We are given an array A of size N which consists of both positive and negative integers. We have to write a program to find the Maximum Sum of Subarray. Note: A subarray is a contiguous part of an Array. Example Input: [2,-3,6,-5,4,2] Output: 7 Explanation: The subarray [6,-5,4,2] is the max sum ...

N/3 Repeat Number

Given an array of integers of size n, we have to find out if any integer occurs more than n/3 times in the array in linear time and constant extra space. If we find an element then print the element else print -1. Scope This article tells about Moore’s Voting Algorithm In this article we ...

Graph Traversal in Data Structure

A graph, a non-linear data structure represented by vertices (nodes) and edges, is defined as an ordered set (V, E) where V represents the set of vertices and E represents the set of edges connecting these vertices. Every pair of vertices is connected by one edge. Graph traversal, a fundamental operation in graph theory and ...