Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Recent questions in Algorithm Challenges
0
votes
0
answers
1
Make Equal Subarray Problem Statement You are given two arrays (A and B) each of size N. You want to change A to B.
Make Equal SubarrayProblem StatementYou are given two arrays (A and B) each of size N.You want to change A to B. Changing the i-th element of A to i-th element of B costs...
rk231219
1.6k
views
rk231219
asked
Jan 5, 2022
1
votes
1
answer
2
Finding best time complexity
$\begin{align*} & a[n] = \{x_1,x_2,x_3,x_4,....,x_n\} \text{ is an array of integers where } n,x_i > 0. \\ & A = \left [ \text{min}\left ( x_i,x_j \right ) \right ] \cdot \left ( j-i \right ) \text{ where } j > i \text{ and } i,j \leq n \\ & \text{What is the best time complexity to find out the value of } A_{\bf max} \; ? \end{align*}$
$\begin{align*} & a[n] = \{x_1,x_2,x_3,x_4,....,x_n\} \text{ is an array of integers where } n,x_i 0. \\ & A = \left [ \text{min}\left ( x_i,x_j \right ) \right ] \cdot ...
dd
1.1k
views
dd
asked
May 27, 2017
Algorithm Challenges
algorithms
time-complexity
+
–
3
votes
2
answers
3
Amazon Interview question on Linked list
Given a linked list : 1->2->3->4->5->6, make the following changes 1->6->2->5->3->4 What would be the most effiicient way to make this change?
Given a linked list :1->2->3->4->5->6,make the following changes1->6->2->5->3->4What would be the most effiicient way to make this change?
sh!va
2.3k
views
sh!va
asked
Jul 21, 2016
Algorithm Challenges
linked-list
algorithms
amazon-interview
+
–
2
votes
2
answers
4
Maximum Continuous Sum in an Array
Given an array of $n$ elements find the maximum continuous sum in it. For example consider the below array of $n=6$. 23 4 -10 2 15 1 Answer is 35.
Given an array of $n$ elements find the maximum continuous sum in it. For example consider the below array of $n=6$.23 4 -10 2 15 1Answer is 35.
Arjun
3.0k
views
Arjun
asked
Jul 3, 2016
Algorithm Challenges
algorithm-challenge
placement-questions
dynamic-programming
+
–
1
votes
0
answers
5
Equivalence of Boolean Expressions
Write an object oriented code for representing boolean expressions and then a function for checking the equivalence of two boolean expressions.
Write an object oriented code for representing boolean expressions and then a function for checking the equivalence of two boolean expressions.
Arjun
449
views
Arjun
asked
Jun 6, 2016
Algorithm Challenges
algorithm-challenge
placement-questions
+
–
0
votes
0
answers
6
Evaluate an arithmetic expression
Given an arithmetic expression involving *, + only write an object oriented code for its representation and evaluation
Given an arithmetic expression involving *, + only write an object oriented code for its representation and evaluation
Arjun
1.1k
views
Arjun
asked
Jun 6, 2016
Algorithm Challenges
algorithm-challenge
placement-questions
+
–
0
votes
2
answers
7
Multiplication without '*'
Write a function (proper programming code) for multiplying two integers without using '*' operator and considering all corner cases.
Write a function (proper programming code) for multiplying two integers without using '*' operator and considering all corner cases.
Arjun
1.2k
views
Arjun
asked
Jun 6, 2016
Algorithm Challenges
placement-questions
+
–
1
votes
4
answers
8
Maximum length substring with k unique characters
Given an input string of length $n$, find the maximum length of the substring containing maximum $k$ unique characters. For example, for "abbcdaadcd" and $k=2$ answer will be 4 for the substring "daad".
Given an input string of length $n$, find the maximum length of the substring containing maximum $k$ unique characters. For example, for "abbcdaadcd" and $k=2$ answer wil...
Arjun
1.9k
views
Arjun
asked
Jun 6, 2016
Algorithm Challenges
placement-questions
interview
+
–
3
votes
1
answer
9
Permutation of String
How to generate permutation of a string? What will be the complexity?
How to generate permutation of a string? What will be the complexity?
Arjun
993
views
Arjun
asked
May 30, 2016
Algorithm Challenges
combinatory
non-gate
+
–
2
votes
1
answer
10
Zigzag Arrangement
Given an array with possible repeating elements you have to rearrange such that elements are alternatively decreasing and increasing (strict increase/decrease). For example, suppose the given array is 1 1 2 3 4 5 one possible answer would be 2 1 3 1 5 4. Assumption: Solution do exist for any given input. Hint: Try to avoid sorting.
Given an array with possible repeating elements you have to rearrange such that elements are alternatively decreasing and increasing (strict increase/decrease). For examp...
Arjun
1.6k
views
Arjun
asked
May 27, 2016
Algorithm Challenges
array
combinatory
placement-questions
+
–
1
votes
1
answer
11
what is the best time complexity to find maximum product of exactly k elements in an array ?
According to me first we sort the array in O(nlogn) time and then in O(k) time , find the product , so total time complexity is O(nlogn) , so am I right or can it be done in lesser time ?
According to me first we sort the array in O(nlogn) time and then in O(k) time , find the product , so total time complexity is O(nlogn) , so am I right or can it be done...
radha gogia
2.0k
views
radha gogia
asked
Apr 10, 2016
Algorithm Challenges
algorithm-challenge
placement-questions
+
–
2
votes
1
answer
12
Open the lock
You are given a number lock of 4 digits and it accepts a serial input. What should be the minimum length of an input string so that the lock is guaranteed to open assuming it opens if any of the consecutive 4 digits matches the code. Also how to get one such sequence?
You are given a number lock of 4 digits and it accepts a serial input. What should be the minimum length of an input string so that the lock is guaranteed to open assumin...
Arjun
1.3k
views
Arjun
asked
Apr 9, 2016
Algorithm Challenges
algorithm-challenge
placement-questions
+
–
To see more, click for the
full list of questions
or
popular tags
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register