-
-
Array Values Algorithms
How many values can be held by an array with dimensions A(0:n), B(-1:n,1:m), C(-n:0,2)?
-
Calculate Primary and Secondary Diagonal
Write an algorithm that calculates all the elements of rows and columns of a square matrix and calculate the total of primary and secondary diagonal.
-
How can you traverse a matrix of m lines and n columns in a zig-zag way ?
Example : 1)m = 3,n = 2 a11 a12 a21 a22a31 a32Output : a11 a21 a12 a31 a22 a322) m = 3, n = 4a11 a12 a13 a14a21 a22 a23 a24a31 a32 a33 a34Output : a11 a21 a12 a31 a22 a13 a32 a23 a14 a33 a24 a34
-
-
Linked List Kth largest Element
How to find the kth largest element in a linked list? Can you do this without using extra memory and also without modifying (sorting) the list?
-
Strings as input
Implement an algorithm that takes two strings as input, and returns the intersection of the two, with each letter represented at most once. Speed it up and test it.
-
-
Duplicate Elements Array
You have an array of size '2n' of these, 'n+1' elements are distinct and 1 element is repeated 'n' times. You must find the repeated element and say how many times it has repeated. Your solution must use minimum no. of comparisons. Also, say how many comparisons your solution will make in the worst case?
-
Linked List
How will you reverse a singly linked list?
-
Sorted Matrix
You are given a matrix. The matrix elements are such that they are sorted both horizontally and vertically. Given an element of the matrix, your job is to obtain its position in an efficient manner.Example: 10 20 30 15 35 98 48 76 110Input: 76Output: 3rd row, 2nd column.
-
-
-
Algorithm Questions
Ans