AfterAcademy Tech
Given a non-negative integer num, write a program to return the number obtained after reversing the bits of num.
Given a non-empty, singly linked list with head node head, write a program to return a middle node of linked list. If there are even nodes, then there would be two middle nodes, we need to print second middle element.
Given an array arr[] consists of 0, 1, 2, 3, 4,.....n. But one of the numbers is missing in it. Write a program to find the number that is missing from the array.
Sorting is a process of arranging items systematically. There are several ways to sort a list of items. A very useful sorting algorithm in all of the sorting algorithms is quicksort. Given an array of integers arr[], write a program to sort the array in ascending order using Quick Sort.
Given two integers n and k, Write a program to return all possible combinations of k numbers out of 1 2 3 ... n. Elements in a combination must be in a non-descending order. The combinations themselves must be sorted in ascending order, i.e., the combination with the smallest first element should be printed first.
There are N children standing in a line with some rating value. You want to distribute a minimum number of candies to these children such that: Each child must have at least one candy. The children with higher ratings will have more candies than their neighbours. Write a program to calculate the minimum candies you must give.
You are given a matrix arr of m x n size. Write a program to searches for a value k in arr. This arr has the following properties: - Integers in each row are sorted from left to right. - The first value of each row is greater than the last value of previous row. This is a basic optimization problem that will clear the concept of searching.
Given a sorted integer array arr[] of n elements and a target value k, write a program to search k in arr[]. The famous binary search algorithm is easy to implement and the best optimization technique for performing searching operations
Given an array of integers arr[] and a target number k, write a program to find all unique combinations in arr[] such that the sum of all integers in the combination is equal to k. This famous backtracking problem has previously been asked in Adobe, Amazon, Facebook.
Given n pairs of parentheses, write a program to generate all combinations of balanced parentheses. You have to return a string array containing all possible cases.