Reverse the array problem:

You are given an array of integers arr[]. You have to reverse the given array. Note: Modify the array in place. Examples: Input: arr = [1, 4, 3, 2, 6, 5] Output: [5, 6, 2, 3, 4, 1]Explanation: The elements of the array are [1, 4, 3, 2, 6, 5]. After reversing the array, the first element goes to … Read more

Leetcode problem no. :1513.

1513. Number of Substrings With Only 1s GENERAL APPROACH We scan the string once from left to right.We count how many consecutive ‘1’ characters appear in a row. => (k⋅(k+1))/2 Then reset the counter. At the end, we add the contribution of the last streak. This approach is optimal with O(n) time and O(1) space. … Read more

SEARCHING

Searching Method : Searching is the process of locating a particular( item or record )from a collection of data elements stored in various data structures like arrays, linked lists, trees, graphs, or databases, based on a given property or key. The items may be stored in different forms such as: Linear search: Linear search techniques … Read more

DBMS

Database is organised collection of interrelated data. The data in the database was interrelated data ,we can share the data , we can concurrently accessed it. Data in the database was interelated that means the data in database is a collection of a several distinct file and collection of some duplicate data.But the duplicacy of … Read more

Asymptotic notations :

There are many asymptotic notations: 1)Big-O Notation (O-notations) (worst case time complexity) 2)Big-O (Upper Bound) 3)Omega Notation(Ω-notations) (Best case time complexity) 4)Big Omega (Lower Bound) 5)Theta Notation(Θ-notations) (average case time complexity) 6)Big Theta (Tight Bound) 7)Small-O (Strictly Less Than) 8)Small-Omega (Strictly Greater Than) But mainly there are three notations :- 1)Big-O notations: – 2)Big-O (Upper … Read more

Commonly used rates of growth

The rate at which the running time increases as a function of Input is called rate of growth:- Time Complexity (Big O) Name Description (Easy Explanation) O(1) Constant Time The program takes the same amount of time no matter how large the input is. ⚡ Example: Accessing an element in an array. O(log n) Logarithmic … Read more

Algorithm

An algorithm is a finite set of instruction that if followed accomplishes a particular task. An algorithm must satisfy the following rules: Input : There are zero or more quantities that are externally supplied Output : At least one quantity is produced. Definiteness : Each instruction is clear and unambiguous. Finiteness : If  trace out … Read more

DSA (DATA STRUCTURE AND ALGORITHM)

DATA + STRUCTURE = DATA STRUCTURE A Data Structure is a way to store, organize, and access data efficiently so that it can be used effectively. Example: In Simpler Words we can say that it is way to store data and accessing of Data. Algorithm: It is a step-by-step procedure or set of instructions used … Read more