bogotech

Helping engineers with technical interviews

Learn linkedlist implementation in ruby

Ruby LinkedList Class Tutorial: Implementation and Usage

Ruby has a built-in linked list class called LinkedList, which is part of the enumerator package. The LinkedList class is a linear data structure that consists of a sequence of nodes, where each node contains a data element and a reference to the next node in the list. Here is an example code to create […]

Read More
Leetcode 463 Island Perimeter

Remove duplicates from a sorted linked list.

Given a sorted linked list, write a function to remove all the duplicate elements from the list, such that each element appears only once. Example: Input: 1 -> 1 -> 2 Output: 1 -> 2… Read More

Read More
Learn linkedlist implementation in ruby

Linked list implementation and operations in Ruby

In Ruby, a linked list is a data structure that consists of a sequence of nodes. Each node in the list contains a data element and a reference (or pointer) to the next node in the sequence. The first node is called the head of the list, and the last node is called the tail […]

Read More

Introduction to skip list: An advanced LinkedList

Skip lists are a probabilistic data structure that uses multiple levels of linked lists to provide efficient search and insertion operations. Each node in a skip list has multiple forward pointers, allowing for efficient traversal of nodes that are farther away from the current node. Skip lists are designed to improve the efficiency of search […]

Read More

Java LinkedList Class Implementation Guide and Examples

LinkedList is a linear data structure that is used to store a collection of elements. It is a sequence of nodes, where each node contains an element and a reference to the next node in the sequence. The first node in the sequence is called the head of the list, while the last node is […]

Read More
Leetcode 463 Island Perimeter

Sort a linked list using shared pointer

Linked lists are commonly used data structures in computer programming. Linked lists consist of nodes that are dynamically allocated, meaning that memory must be manually managed. Memory management can be a complex and error-prone task, and to make it easier, shared pointers are used in linked list implementation. Shared pointers are smart pointers that help […]

Read More
Leetcode 463 Island Perimeter

Swapping nodes in a linked list

Swapping nodes in a linked list means exchanging the positions of two nodes in the list. For example, if we have a linked list 1 -> 2 -> 3 -> 4 -> 5 and we want to swap the second and fourth nodes, the result will be 1 -> 4 -> 3 -> 2 -> […]

Read More

Implement doubly linked list using shared ptr

A shared pointer is a smart pointer that can manage the lifetime of an object by keeping track of how many pointers are pointing to it. In a doubly linked list, a shared pointer can be used to manage the memory of the nodes. In a doubly linked list, each node has two pointers: a […]

Read More
Leetcode 463 Island Perimeter

Write a program to find the number of days between two dates

Using datetime library in your choice of language makes it easy to write a program to find the number of days between two dates. We write code with and without using the library. Let’s first find the number of days between two dates with using a library: 1. Prompt the user to enter the first […]

Read More
Leetcode 463 Island Perimeter

How to combine two column matrices in Python

To combine two column matrices in Python, you can use the concatenate function from the numpy library. Although using libraries in a coding interview for a software engineering role can be both helpful and risky. On one hand, libraries can save you time and make it easier to write code that works. On the other […]

Read More

Page 3 of 5

Powered by WordPress & Theme by Anders Norén