Showing posts with label Lectures. Show all posts
Showing posts with label Lectures. Show all posts

Tuesday, 12 March 2024

Lecture 2

 Pointers:-

Pointers are a type of variable that allow you to specify the address of a variable. They provide a convenient means of passing arguments to functions and for referring to more complex data types such as structures. You need to declare and initialize pointers just as you would other variables, but there are special operators that you need to use.


Address Operator (&): 

The "address of " operator (&) gives the memory address of the variable.


 Declaration and Initialization of Pointer variables:

type* pointer_name;

            //or

type *pointer_name;


type*pointer_name=&variable_name;








The * Operator Dereference: 

The star operator (*) dereferences a pointer. The * is a unary operator which goes to the left of the pointer it dereferences. The pointer must have a pointee, or it's a runtime error.




Pointer to Pointer:




Types of Pointers

i) Null Pointer

A pointer should be set to zero when it is not assigned to a valid address. Such a pointer is called a null pointer. Doing this will allow you to check whether the pointer can be safely dereferenced, because a valid pointer will never be zero.



i) Void Pointer 

A void pointer is a pointer that has no associated data type with it. A void pointer can hold address of any type and can be type casted to any type.




Incrementing Pointer:




Decrementing Pointer:



** Try the output of above programs by yourselfs...😀Hope this is going to be easy for you.







Friday, 1 March 2024

Lecture 1

Following is the content of this lecture:

  • Deletion in an array
  • Update in an array
  • Find max and min in an array
  • Traverse
  • Search
  • Insertion in an array
Basic DSA Terminologies
Data − Data are values or set of values. Data Item − Data item refers to single unit of values. Group Items − Data items that are divided into sub items are called as Group Items. Elementary Items − Data items that cannot be divided are called as Elementary Items.



Are you worried no need lets continue








What is DSA? 
DSA is defined as a combination of two separate yet interrelated topics – Data Structure and Algorithms. DSA is one of the most important skills that every computer science student must have.




Algorithm 
It is a well-defined, systematic logical approach that comes with a step-by-step procedure for computers to solve any given program. Program – It refers to the code (written by programmers) for any program that follows the basic rules of the concerned programming language.






WHY WE LEARN
By learning data structures and algorithms, you can improve your problem-solving skills and apply them to build better software solutions. Efficient code is critical to building software applications that can handle large amounts of data and user traffic.