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
Frontend Developer Roadmap 2024
Frontend development means to design the face of a website or application. It involves working on the appearance of the website. Building interactive buttons, using images...
Read More
Maximum XOR-value of at-most k-elements from 1 to n
You are given two positive integer n and k. You have to calculate the maximum possible XOR value of at most k-elements from 1 to n.Note:k 1Examples :Input : n = 7, k = 3O...
Read More
Bit Magic
Bitwise-XOR
DSA
Minimum distance between two occurrences of maximum
You are given an array of n-elements with a basic condition that occurrence of greatest element is more than once. You have to find the minimum distance between maximums. ...
Read More
Arrays
Searching
DSA
Iterative approach for removing middle points in a linked list of line segments
This post explains the iterative approach of this problem.We maintain two pointers, prev and temp. If these two have either x or y same, we move forward till the equality ...
Read More
Linked List
Linked Lists
DSA
Fibonacci Series in Bash
Prerequisite: Fibonacci Series Write a program to print the Fibonacci sequence up to nth digit using Bash. Examples:Input : 5Output :Fibonacci Series is : 01123Input :4Out...
Read More
Linux-Unix
Shell Script
Rearrange characters to form palindrome if possible
Given a string, convert the string to palindrome without any modifications like adding a character, removing a character, replacing a character etc.Examples:Input : "mdaam...
Read More
Strings
palindrome
cpp-unordered_map
frequency-counting
DSA
GATE | GATE CS 2018 | Question 43
Consider the following parse tree for the expression a#b$c$d#e#f, involving two binary operators $ and #.Which one of the following is correct for the given parse tree?(A)...
Read More
GATE
GATE-GATE CS 2018
GATE CS 2018
GATE | GATE CS 2018 | Question 42
Consider Guwahati (G) and Delhi (D) whose temperatures can be classified as high (H), medium (M) and low (L). Let P(HG) denote the probability that Guwahati has high tempe...
Read More
GATE
GATE-GATE CS 2018
GATE CS 2018
GATE | GATE CS 2018 | Question 41
Consider the following solution to the producer-consumer synchronization problem. The shared buffer size is N. Three semaphores empty, full and mutex are defin...
Read More
GATE
GATE-GATE CS 2018
GATE CS 2018
GATE | GATE CS 2018 | Question 40
Given a language L, define Li as follows:L0 = {ε}Li = Li-1∙L for all i>0The order of a language L is defined as the smallest k such that Lk=Lk+1. Consider the language L1 ...
Read More
GATE
GATE-GATE CS 2018
GATE CS 2018
GATE | GATE CS 2018 | Question 39
A processor has 16 integer registers (R0, R1, … , R15) and 64 floating point registers (F0, F1, … , F63). It uses a 2-byte instruction format. There are four categories of...
Read More
GATE
GATE-GATE CS 2018
GATE CS 2018
GATE | GATE CS 2018 | Question 38
Consider a simple communication system where multiple nodes are connected by a shared broadcast medium (like Ethernet or wireless). The nodes in the system use the followi...
Read More
GATE
GATE-GATE CS 2018
GATE CS 2018
GATE | GATE CS 2018 | Question 37
Consider an IP packet with a length of 4,500 bytes that includes a 20-byte IPv4 header ans 40-byte TCP header. The packet is forwarded to an IPv4 router that supports a Ma...
Read More
GATE
GATE-GATE CS 2018
GATE CS 2018
GATE | GATE CS 2018 | Question 36
Consider a storage disk with 4 platters (numbered as 0, 1, 2 and 3), 200 cylinders (numbered as 0, 1, … , 199), and 256 sectors per track (numbered as 0, 1, … 255). The fo...
Read More
GATE
GATE-GATE CS 2018
GATE CS 2018
GATE | GATE CS 2018 | Question 35
Consider the following processor design characteristics.I. Register-to-register arithmetic operations onlyII. Fixed-length instruction formatIII. Hardwired control unitWhi...
Read More
GATE
GATE-GATE CS 2018
GATE CS 2018
GATE | GATE CS 2018 | Question 34
Match the following:(A) P-III, Q-IV, R-II, S-I(B) P-II, Q-I, R-IV, S-III(C) P-IV, Q-I, R-II, S-III(D) P-IV, Q-I, R-III, S-II Answer: (C) Explanation: UDP Header's Port num...
Read More
GATE
GATE-GATE CS 2018
GATE CS 2018
1
...
11181
11182
11183
...
11293