Category: Fundamentals

0

Implement a power function

Naive logic: Loop through the number of times the exponent, and during each iteration multiply the base If our exponent is 10,000 then our loop has to run 10,000 times. But we can optimize...

0

Withdraw all money from bank account

Problem : You have some money in your bank account, the only function to withdraw money is Withdraw(value), if the value is greater than the money you have it returns 0, otherwise it withdraws...

0

Binary tree traversal

Problem description : Tree traversal (a.k.a tree search) is a form of graph traversal and refers to the process of visiting each node in a tree data structure, exactly once, in a systematic way....

0

Create a binary search tree in javascript

Create a simple binary search tree data structure in javascript. Binary tree : It is a tree data structure in which each node has at most two children, which are referred to as the...

Create a simple queue using javascript 0

Create a simple queue using javascript

Problem description : Create a simple queue data structure in javascript. Queue organizes data into the sequential order. It similar to the a queue of people waiting to get a bus ticket. It’s a...

Show Buttons
Hide Buttons