Skip to content
All Basic Articles
Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is… Read More
Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is… Read More
LCM (Least Common Multiple) of two numbers is the smallest number which can be divided by both numbers. For example, LCM of 15 and 20 is… Read More
GCD (Greatest Common Divisor) or HCF (Highest Common Factor) of two numbers is the largest number that divides both of them.  For example GCD of… Read More
We have discussed Linked List Introduction and Linked List Insertion in previous posts on a singly linked list.Let us formulate the problem statement to understand… Read More
Given an array, cyclically rotate the array clockwise by one. Examples: Input: arr[] = {1, 2, 3, 4, 5} Output: arr[] = {5, 1, 2,… Read More
Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. The objective of the puzzle is to move the entire… Read More
Given an array, find the largest element in it. Example:   Input : arr[] = {10, 20, 4} Output : 20 Input : arr[] = {20, 10,… Read More
Given an array, find the largest element in it. Input : arr[] = {10, 20, 4} Output : 20 Input : arr[] = {20, 10,… Read More
Write a C language code that prints GeeksforGeeks without any main function. Logically it’s seems impossible to write a C program without using a main()… Read More
The statement that is executed automatically by the system as a side effect of the modification of the database is (A) backup (B) assertion (C)… Read More
An operating system uses shortest remaining time first scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes with their arrival times… Read More
A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that… Read More
Let X and Y be finite sets and f: X -> Y be a function. Which one of the following statements is TRUE? (A) A… Read More
Which one of the following Boolean expressions is NOT a tautology? (A) A (B) B (C) C (D) D Answer: (B) Explanation: (A) a ->… Read More
A priority queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is: 10, 8, 5, 3, 2.… Read More
Which one of the following propositional logic formulas is TRUE when exactly two of p, q, and r are TRUE? (A) A (B) B (C)… Read More
Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3, 4, 2, 1, 5, 3,… Read More
Which one of the following is FALSE? (A) User level threads are not scheduled by the kernel. (B) When a user level thread is blocked,… Read More
(A) {q0, q1, q2} (B) {q0, q1} (C) {q0, q1, q2, q3} (D) {q3} Answer: (A) Explanation:   So, q0, q1 and q2 are reachable… Read More