Courses
Tutorials
Jobs
Practice
Contests
Data Structure
Java
Python
HTML
Interview Preparation
Trending Now
DSA
Web Tech
Foundational Courses
Data Science
Practice Problem
Python
Machine Learning
JavaScript
System Design
Django
DevOps Tutorial
Java
C
C++
ReactJS
NodeJS
CP Live
Aptitude
Puzzles
Projects
GBlog
Three 90 Challenge: Bigger and Better
As we transit into the new phase, it's essential to fuel our inner drive for success. On popular demand, GeeksforGeeks is happy to announce that we are back with the Thre...
Read More
Working with Git Repositories
Git is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.Git relies on th...
Read More
Git
Perform append, update, delete and range sum queries on the given array
Given an array arr[] of size N and the task is to answer Q queries of the following types:1 X 0: Append X at the back of the array.2 X Y: Set arr[X] = Y.3 X 0: Delete arr[...
Read More
Arrays
Algorithms
Advanced Data Structure
Competitive Programming
Segment-Tree
BIT
Data Structures
C++ Programs
DSA
Value to be subtracted from array elements to make sum of all elements equals K
Given an integer K and an array, height[] where height[i] denotes the height of the ith tree in a forest. The task is to make a cut of height X from the ground such that e...
Read More
Arrays
Goldman Sachs
Binary Search
Algorithms
Searching
Sorting
DSA
Minimum possible travel cost among N cities
There are N cities situated on a straight road and each is separated by a distance of 1 unit. You have to reach the (N + 1)th city by boarding a bus. The ith city would co...
Read More
Algorithms
Greedy
DSA
Python: os.path.abspath() method with example
OS module in Python provides various methods for interacting with the operating system. It comes under Python's standard utility module, so there is no need to install it ...
Read More
Python
Python Programs
Python OS-path-module
Python directory-program
Python - os.pardir() method with example
In Python, OS module provides various functions to interact with the operating system. This module comes under the Python standard utility module, so there is no need to i...
Read More
Python
Python Programs
python-os-module
Python directory-program
Ruby Hook Methods
Ruby Hook Methods are called in reaction to something you do. They are usually used to extend the working of methods at run time. These methods are not defined by default,...
Read More
Technical Scripter
Ruby
Picked
Ruby-OOP
Ruby Keyword
Queries to check if the path between two nodes in a tree is a palindrome
Given a tree with N nodes and N - 1 edges. Each edge of the tree is labeled by a string of lowercase english alphabets. You are given Q queries. In each query you are give...
Read More
Strings
Tree
palindrome
LCA
DSA
Create a sorted linked list from the given Binary Tree
Given a binary tree, the task is to convert it into a sorted linked list.Examples:Input: 1 / \ 2 3 Output: 1 2 3Input: 2 / \ 4 8 / ...
Read More
Linked List
Tree
DSA
Ruby Directories
A directory is a location where files can be stored. For Ruby, the Dir class and the FileUtils module manages directories and the File class handles the files. Double dot ...
Read More
Ruby
Picked
Ruby-OOP
Count of times second string can be formed from the characters of first string
Given two strings str and patt, the task is to find the count of times patt can be formed using the characters of str.Examples:Input: str = "geeksforgeeks", patt = "geeks"...
Read More
Strings
Mathematical
frequency-counting
DSA
Python : __delete__ vs __del__
Both __delete__ and __del__ are dunder or magic methods in Python. Dunder or magic methods in Python are the methods having two prefix and suffix underscores in the method...
Read More
Technical Scripter
Python
python-oop-concepts
Picked
Technical Scripter 2019
Count of subarrays having exactly K distinct elements
Given an array arr[] of size N and an integer K. The task is to find the count of subarrays such that each subarray has exactly K distinct elements.Examples:Input: arr[] =...
Read More
Arrays
Algorithms
subarray
sliding-window
DSA
Color tree with minimum colors such that colors of edges incident to a vertex are different
Given a tree with N nodes. The task is to color the tree with the minimum number of colors(K) such that the colors of the edges incident to a vertex are different. Print K...
Read More
Tree
BFS
DSA
Number of cells in a matrix that satisfy the given condition
Given an N * N grid consisting of empty cells (denoted by '1') and obstacles (denoted by '0'), the task is to find the number of empty cells in which a mirror can be place...
Read More
Algorithms
Dynamic Programming
Matrix
Competitive Programming
DSA
1
...
8837
8838
8839
...
11255