Download as pdf
Download as pdf
You are on page 1of 1
BASIC PROGRAMS, 1. Sum of three Integer adds to ZERO ‘a, Desc=> A program with cubic running time. Read in N integers and counts the number of triples that sum to exactly 0. b./P-> Nnumber of integer, and N integer input array . Logic -> Find distinct triptes (i,j,k) such that af] + afj} + afk] = 0 d.0/P-> One Output is number of distinct triplets as well as the second output is to print the distinct triplets 2, Write a program Distance,java that takes two integer command-line arguments x and y and prints the Euclidean distance from the point (x, y) to the origin (0, 0). The Formulae to calculate distance = sqrt(x*x + y*y). Use Math.power function INTERMEDIATE LEVEL PROGRAMS 1. You are given an array of numbers. Find out the array index or position where sum of numbers preceeding the index is equals to sum of numbers succeeding the index. Eg: (2,4,4)5,4,1) Output: Starting From index 0, adding numbers till index 2 and adding rest of the numbers can be equal 2. How to Find sub array with largest product in array of both positive and negative number Example: Given the array [2,3,-2,4] the contiguous subarray [2,3] has the largest product = 6. : LINKED LIST BASED PROGRAM 1. Split a Circular Linked List into two halves Head —+f 12 |e) 56/4] 2 [ea | & Head2 Hoadt 12| e456 | «

You might also like