Competitive programming questions
4.52K subscribers
14 links
Solving competitive Programming Questions one day at a time.

Group link:
https://t.me/competitive_programming_question
Please forward it to your friends
Download Telegram
I am seeing that, no one is writing the solution in the comment section of the post to evaluate. Please add your solution in any language in the comment section of the website
Forwarded from Competitive Programming
What is the worst-case time complexity of inserting n elements into an initially empty binary heap one by one?
Anonymous Quiz
11%
• A) O(n)
72%
• B) \(O(n \log n)\)
11%
• C) \(O(\log n)\)
6%
• D) O(n²)
Forwarded from Competitive Programming
Which traversal of a Binary Search Tree (BST) outputs its elements in strictly ascending sorted order (assuming no duplicates)?
Anonymous Quiz
29%
A) Pre-order
18%
B) Post-order
47%
C) In-order
6%
D) Level-order
Day 10 Question:

Find the Container with Most Water explanation with diagram and solution

Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water.

Input: [3, 5, 4, 6]
Output: [15]

Solution:

https://prodevelopertutorial.com/find-the-container-with-most-water-explanation-with-diagram-and-solution/

You can add your solutions in the comment section:



Whatsapp Channel: https://whatsapp.com/channel/0029VbEBBOo9sBIEzSFDqT0u
Telegram Channel: @competitive_programming_question
Telegram Group for discussion: @coding_interview_prep
Instagram: https://www.instagram.com/fastpacedalgorithms/
Website: www.ProDeveloperTutorial.com
Forwarded from Competitive Programming
Which algorithm is best suited for finding the shortest path in a weighted graph that contains negative edge weights (but no negative weight cycles)?
Anonymous Quiz
39%
• A) Dijkstra's Algorithm
4%
• B) Prim's Algorithm
54%
• C) Bellman-Ford Algorithm
4%
• D) Breadth-First Search (BFS)
Day 12 Question:


Given a collection of candidate numbers and a key, find all unique combinations in candidates where the candidate numbers sums to target.

Input: candidates = [10,1,2,7,6,1,5], target = 8,
A solution set is:
[
[1, 7],
[1, 2, 5],
[2, 6],
[1, 1, 6]
]

Solution:

https://prodevelopertutorial.com/given-a-collection-of-candidate-numbers-and-a-key-find-all-unique-combinations-in-candidates-where-the-candidate-numbers-sums-to-target/

You can add your solutions in the comment section.
Forwarded from Competitive Programming
Which of the following sorting algorithms is not stable in its standard implementation?
Anonymous Quiz
28%
• A) Merge Sort
25%
• B) Insertion Sort
17%
• C) Bubble Sort
31%
• D) Quick Sort