Link List

Posted by admin at June 11, 2020

A link list is one of the fundamental data structures and can be used to implement other data structures. It consists of a sequence of nodes, each containing (one or more as per requirement) data fields and one (or two) references ( two for doubly link list) pointing to the next (or previous) nodes. We […]

Continue

Return largest number in arrays

Posted by admin at April 10, 2020

Problem Explanation You will get an array that contains sub arrays of numbers and you need to return an array with the largest number from each of the sub arrays. Hints Hint 1 You will get an array that contains sub arrays of numbers and you need to return an array with the largest number […]

Continue

Bubble Sort

Posted by admin at April 4, 2020

Let’s again consider the following array:4,9,7,1,3,6,5 We start at the front of the array and compare each pair of numbers. If they are out of order(ascending order), we swap them. Then, we move to the next pair and repeat the same process. Let’s see what would happen to this array if we follow this procedure. […]

Continue

Find the Longest Word in a String: JavaScript

Posted by admin at April 2, 2020

Problem Explanation You have to go through each word and figure out which one is the longest and return not the word, but how many characters it has. Hints Hint 1 You should split the string into an array of words. Hint 2 You will need to figure out a way to keep track globally […]

Continue

Factorialize a Number: JavaScript

Posted by admin at

You know your solution should return 1 when the number passed to the function is 0 or 1. Also, the final value returned will be the product of all the numbers between 1 and the number (inclusive). If you initialize the value for the product to 1, then think how you could start at the given number and continue decrementing this […]

Continue

Reverse a String: JavaScript

Posted by admin at

We need to take the string and reverse it, so if it originally reads ‘hello’, it will now read ‘olleh’. You can reverse the string by creating a new string (initializing it to a blank string “”) and then iterating the string starting from the last character through the first character and the concatenating each […]

Continue

Sorting

Posted by admin at January 19, 2020

Sorting is one of the fundamental and most useful algorithm. There are many situations where we might want to sort our data in some order. For example, we are given a group of kids and we want to line them up in order of age. The youngest at the front of the line, and the […]

Continue

Top 50 Data structure questions

Posted by admin at November 6, 2019

Write a program to find the missing number in a given integer array of 1 to 100. Write a program to find the duplicate number on a given integer array. Write a program to find the largest and smallest number in an unsorted integer array. Write a program to find all pairs of an integer […]

Continue

Data Structure Quick Guide

Posted by admin at

1) What is data structure? Data structure refers to the way data is organized and manipulated. It seeks to find ways to make data access more efficient. When dealing with the data structure, we not only focus on one piece of data but the different set of data and how they can relate to one another […]

Continue