Google

Find Intersection of Two Singly Linked Lists

You are given two singly linked lists that intersect at some node. Your task is to find and return the…

10 months ago

Longest Absolute Path in File System Representation

Find the length of the longest absolute path to a file within the abstracted file system. The length is measured…

11 months ago

Estimate π Using Monte Carlo Method

The formula for the area of a circle is given by πr². Use the Monte Carlo method to approximate the…

12 months ago

Count Unival Subtrees in a Binary Tree

A unival tree (short for "universal value tree") is a tree in which all nodes have the same value. Given…

1 year ago

Implement an XOR Linked List

An XOR-linked list is a memory-efficient version of a doubly linked list. Instead of each node storing separate next and…

1 year ago

Serialize and Deserialize a Binary Tree

Given the root of a binary tree, create two functions: serialize(root) - Converts the binary tree into a string representation.…

1 year ago