Articles on Trending Technologies

Technical articles with clear explanations and examples

How to use Boto3 to paginate through all objects of a S3 bucket present in AWS Glue

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 4K+ Views

Boto3 is a Python SDK for AWS that allows you to interact with AWS services. When working with large S3 buckets containing thousands of objects, pagination helps retrieve data in manageable chunks rather than loading everything at once. Why Use Pagination? S3 buckets can contain millions of objects. Loading all objects at once can cause memory issues and timeouts. Pagination allows you to: Process objects in smaller batches Reduce memory usage Handle large datasets efficiently Resume from a specific point using tokens Key Parameters The ...

Read More

Python Program to Construct a Tree & Perform Insertion, Deletion, Display

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 809 Views

When building a tree data structure in Python, we need to construct a tree and perform operations such as inserting an element, deleting an element and displaying elements of the tree. This can be achieved by defining a class with methods for these operations. Below is a demonstration of the same − Tree Structure Implementation class Tree_struct: def __init__(self, data=None, parent=None): self.key = data self.children = [] self.parent ...

Read More

Check whether a number has consecutive 0's in the given base or not using Python

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 329 Views

When working with different number bases, we sometimes need to check if a number contains consecutive zeros in its representation. Python provides an efficient way to convert numbers between bases and detect patterns like consecutive zeros. Understanding the Problem For example, the number 8 in base 2 (binary) is represented as "1000", which contains consecutive zeros. We need to convert the number to the specified base and then check for consecutive zero digits. Complete Solution def check_consecutive_zero(N, K): my_result = convert_to_base(N, K) if (check_consecutive_zeros(my_result)): ...

Read More

Python Program to Implement a Stack

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 4K+ Views

A stack is a Last-In-First-Out (LIFO) data structure where elements are added and removed from the same end (the top). In Python, we can implement a stack using a class with methods for push, pop, and checking if the stack is empty. Stack Implementation Here's a complete stack implementation with push, pop, and empty check operations ? class Stack: def __init__(self): self.items = [] def is_empty(self): return ...

Read More

How to get the list of all versions of the object from S3 present in AWS Resource

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 3K+ Views

In this article, we will see how to get the list of all versions of objects from S3 using boto3 in Python. This is useful when S3 versioning is enabled and you need to track object history. Prerequisites Before running this code, ensure you have ? AWS credentials configured (via AWS CLI, IAM roles, or environment variables) S3 bucket with versioning enabled boto3 library installed: pip install boto3 Approach We'll use the list_object_versions() method from the S3 client to retrieve all versions of objects in a specific bucket and prefix ? ...

Read More

Python Program To Find the Smallest and Largest Elements in the Binary Search Tree

Farhan Muhamed
Farhan Muhamed
Updated on 25-Mar-2026 705 Views

In this article, we will explain how to find the minimum and maximum values in a binary search tree (BST), with implementation in Python. A binary search tree is a data structure that stores data in a sorted order such that for every node, the left subtree contains values less than the node's value, and the right subtree contains values greater than the node's value. So the leftmost node will have the minimum value, and the rightmost node will have the maximum value. Problem Statement Given the root node of a binary search tree, find the node ...

Read More

How to use Boto3 to paginate through all triggers present in AWS Glue

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 320 Views

Problem Statement: Use boto3 library in Python to paginate through all triggers from AWS Glue Data Catalog that is created in your account Approach/Algorithm to solve this problem Step 1: Import boto3 and botocore exceptions to handle exceptions. Step 2: max_items, page_size and starting_token are the optional parameters for this function max_items denote the total number of records to return. ...

Read More

Python Program to Find Nth Node in the Inorder Traversal of a Tree

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 349 Views

Finding the nth node in inorder traversal of a binary tree is a common problem in tree algorithms. Inorder traversal visits nodes in the order: left subtree → root → right subtree. This article demonstrates how to find the nth node efficiently using a binary tree class with inorder traversal methods. Understanding Inorder Traversal In inorder traversal, nodes are visited in this sequence: Traverse the left subtree Visit the root node Traverse the right subtree For a binary search tree, inorder traversal gives nodes in sorted order. Binary Tree Implementation Here's a complete ...

Read More

How to use Boto3 to paginate through all tables present in AWS Glue

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 994 Views

AWS Glue Data Catalog stores metadata about your data sources. When you have many tables, pagination helps retrieve them efficiently without overwhelming your application. The boto3 library provides built-in pagination support for AWS Glue operations. Understanding Pagination Parameters The pagination configuration accepts three optional parameters: max_items: Total number of records to return across all pages page_size: Number of records per page (default is 100) starting_token: Token from previous response to resume pagination Setting up AWS Glue Client First, create a boto3 session and Glue client. Ensure your AWS credentials and region are configured ...

Read More

Python Program to Convert a given Singly Linked List to a Circular List

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 539 Views

A singly linked list can be converted to a circular linked list by making the last node point to the head node instead of None. This creates a circular structure where traversal can continue indefinitely. Node and LinkedList Structure First, we define the basic node and linked list classes ? class Node: def __init__(self, data): self.data = data self.next = None class LinkedList_struct: def __init__(self): ...

Read More
Showing 4961–4970 of 61,299 articles
« Prev 1 495 496 497 498 499 6130 Next »
Advertisements