Monday, 31 May 2021

How to start programming

How to start programming 


  • Introduction to the c++ programming language :- 


C++ is a high level programming language which is used to communicate with the compter 


It is a cross-platform language that can be used to create high-performance applications.


It was developed by Bjarne Stroustrup as an extension to the C language


The changes were made to make the language more efficient and more affective then the previous one 


Also the changes were made in C++ also over the time as per the current requirement to meet the user experiece and to enhance the capabelities of language changes were introduced 


More about C++ language :- 


C++ is the oldest as well as very popular programming languages 


It can be found in many operating system today also it is used for gaphical user interfaces and embedded systems 


C++ is anobject oriented programming language which gives a clear structure to programs and allows code to be reused,lowering development costs. 


C++ is a portable language means the programm which is written on a particular hardware can be used on different platforms 


Also it is user friendly and easy to learn 


As it is close to the languages like C# and Java so that it makes easy for programmers to switch to C++ or vice versa. 


As we have seen that C++ programs are used to make graphic oriented interface so that it is used in the development various games 


Because it the oldest language C++ is embeded in the core of various operating system 



  • How to write programs :- 


While learning any language the very first thing which we have to learn is the grammer and vocubalery part of that particular language.


Same applies in the programming also to learn any programmng language very first we need to learn syntax and commands of that language which is same as the grammer and vocubalery of any language 


Also we need to learn datastructures as well as algorithm to understand the programming and to develope problem solving skills 


Algorithm :- Algorithm is a step-by-step procedure, which defines a set of instructions to be executed in a certain order to get the desired output 


Algorithms are generally created independent of underlying languages


An algorithm can be implemented in more than one programming language 


It is simply a procedure which is to be followed to solve any real world problem 


In a good algorithm input and output should be defined precisely so that it helps in understanding a problem very efficiently 


Each step of a algorithm should be clear and unambiguous 


An algorithm shouldn’t include computer code it simply states the procedure to solve any real world problem 


An algorithm is made in such manner so that it can be used in more than one programming languaes


To develope a good program it is required to develope a good and a efficient pre-code planning and organization and which is assisted by the use of pseudocode and program flowcharts. 


Flowcharts :- Flowcharts are writen with program flow from the top of the page to the bottom to the page. Each command is placed in a box of the appropriate shape, and arrows are used to show the control flow of ther program the following shapes are often used in flowcart 


  1. Oval shape :- an oval shape in the flow chart shows the begening nd end of the program 

  2. Parallelogram :- a parallelogram is a point where there is input to or output from the program 

  3. Rectangle :- a rectangle indicates the assignment of a value to a variable, constant or parameters



COMMUNICATION SKILLS ASSIGNMNET-3

  COMMUNICATION SKILLS ASSIGNMNET-3

                Name-  ADARSH GUPTA 

               Roll No- 19EAICS006


1.Change the following into passive voice.

a) I had purchased a motorcycle last year.

Ans. A motorcycle had been purchased by me last year.


b) Anita prepares breakfast every day.

Ans. Breakfast is prepared by Anita every day.


c) Pardon me.

Ans. let me be pardoned.


d) Who wrote this book?

Ans. By whom this book was written?


e) The teacher punished the irregular students.

Ans. The irregular students were punished by the teacher.


2.Change to indirect speech.

a) My father says, “you always waste money”.

Ans. My father says that I always waste money.


b) My friend said, “I don’t have rice”.

Ans. My friend said that he didn’t have rice.


c) The officer said to the clerk, “why have you not typed this letter”?

ans. The officer told to the clerk that why he had not typed this letter?


d) He said to me,” let’s go to see a movie”.

Ans. He proposed me that we should go to see a movie.


e) My friend will say,” I am watching tv”.

Ans. My friend would say that he is watching tv.


3.Fill in the blanks with appropriate models.

Q) The doctor__ cure the patient.

Ans. Should


Q) As a child I __gaze at the stars for hours.

Ans. Can 


Q) There were clouds in the sky. It__rain.

Ans. May


Q) I __whether drink then commit adultery.

Ans. Would


Q) __the almighty shower his blessing on you.

Ans. May


4. Complete the following sentences with correct form of conditions.

a. If we had taken in a water.

Ans. We would not have any shortage of water for several days.


b. she would go to the party.

Ans. If her parents permit her.


c. If I were you.

Ans. I would enjoy my vacation.


d. if it rains. 

Ans. The grass gets wet.


e. If the teacher spoke clearly.

Ans. Students will understand easily.


5. Correct the following sentences.

a. We cannot imagined it.

Ans. We cannot imagine it.


b. Do your grandmother not like to read religious book.

Ans. Does your grandmother not like to read a religious book.


c. We shall be watch the movie.

Ans. We shall watch the movie.


d. Let her watered the plants.

Ans. Let her water the plants.


e. Neither kin nor Shelby are to go into the cave.

Ans. Neither kin nor Shelby are going into the cave.


6. Write in brief.

a.) Give three examples of direct speech.

     1. she said, “I am watching a movie”.

      2. he said to me,” you should work hard to pass the exam”.

     3. he says,” jack kills a giant”.


b.) what do you mean by auxiliary verbs?

Ans. Modals (are also called model verbs, model auxiliary verbs, modal auxiliary) are special verbs which behave irregularly into English. They are different from normal verbs like “work, play, visit”. they give additional information about the function of the name verb that follows it.

We use models to do things like walking about ability asking permission making requests and offers so on e.g., can,could,shall,should etc.


c.) what are different types of conditional sentences?

Ans. Conditional sentences express hypothetical situations and their consequences. They are used to express that the action in the min clause can only take place if a certain condition is fulfilled.

Conditional sentences are also known as conditional clause or if clauses.

Conditional sentences consist of two parts.

  1. A an if clause

  2. A main clause

The if clause is also known as the subordinate’s clause or condition clause, which contain such condition.

The event described in the, maim clause depends on the conditions described in the main clause.

e.g.:

1 ) If it rains we will go for a picnic .

2)if the work is over. I shall leave for home.

   … (if clause) ………….(main clause)……….

There are three types of conditional sentences each comprising different pair of tenses.

TYPE 1: OPEN OR LIKELY OR PROBABLE CONDITION

In this type of verb in the if clause is in the present simple and the verb in the main clause is in the simple future.

Eg-1) if you work hard, you will pass the examination

Here “if you work hard” is in simple present &” you will pass the examination is in simple future.

  

-VARIATIONS IN A MAIN CLAUSE.

a) if + simple present tense + may(possibility)

E.g.-If the fog gets thicker, I may/might cancel my trip.



b) if +simple present tense+ can (Ability or permission)

E.g.-If you speak Chinese, I cannot understand you.

 

c)if +simple present tense+ must(compulsion)

E.g.-if you want to lose weight, you must exercise.


d)if +simple present tense+ may(permission)

E.g.-If your documents are in order.


e) if +simple present tense+ should (request or advice)

E.g.-You should go for a walk, if rain stops


f) if +simple present tense+ simple present tense

E.g.-if you want to speak better you should study phonetics.


-VARIATIONS OF THE CLAUSE


a) if + present continuous tense.

E.g.if you are studying ,I will switch the lights on.


NOTE: -The use of present continuous in the if clause shows the status of the action-present and future arrangement. 


b) If + present perfect tense.

e.g.-if the student has completed the assignments, I will correct them in class.


NOTE: -The use of present perfect indicates completion of an action.


TYPE 2: -Unlikely or improbable or imaginary conditions.


If clause indicates unreality when the past tense in the if clause is not a true part. The verb in the if clause is in the past tense.

E.g. This soup would taste better if it had more salts in it.



-VARIATIONS OF THE MAIN CLAUSE

In this ‘would’ can be replaced by ‘could’ and ‘might’.


a) If I had a type writer I would type it myself. 

  

b) if + past perfect.

E.g if he had taken my advice, he would be an engineer now.



TYPE 3: - IMPOSSIBLE CONDITIONS 

The action in the if clause, does not happen as the time is past and the conditions cannot be fulfilled . The verb in the if clause is in the past perfect conditional tense.

                            (could + have +past participle)

e.g.- 

1)If they have been stronger, they would have lifted the table.

2)If he had listened more carefully, he wouldn’t have made so mistakes.



-VARIATIONS AT MAIN CLAUSE 

a) if + past perfect + could (ability)

E.g.-if they had been stronger, they could have lifted the table.


b) if +past tense + might (possibility)

E.g.-If you tried again you might win.


c)if + past tense +past tense.

e.g.-if anyone interrupt him, he got angry.


-Variation of the if clause


a)if + past continuous tense

Instead of using past simple into the if clause we can use past continuous form

b) if + past perfect +might

E.g.-if they has known the answers they might have told me.


D. what are different parts of speech?

Ans. The words of the speaker can be reported into two ways.

  1. Direct speech

  2. Indirect speech

  1. Direct speech: -in direct speech we may push question the actual words of the speaker e.g.- he said, “I have lost my phone”.

       ii)            Indirect speech; -in indirect speech we may report what the person said without questioning the exact words.

E.g.-He said that he had lost his mobile phone.



E. Give four examples of voice.

a) Active voice:-I will clean the house every Saturday.

            “’””””   :-We are going to watch a movie tonight.

                           : -Joseph throw the ball threw the neighbours window.

                           : - The teacher punished the irregular students.

b) Passive voice: -The house will be cleaned by me every Saturday.

        “””””””      :- A movie is going to be watched by us tonight.

                           : -The ball was thrown through the neighbour’s window via joseph. 

                           : -The irregular students were punished by the teacher.


 








 


Pre-Placements Checklist

 Pre-Placements Checklist

Data Structures:


  1. Array

    1. Kadane's Algorithm

https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/ 

  1. N/2, N/3 greatest Number

https://leetcode.com/problems/majority-element/ 

https://leetcode.com/problems/majority-element-ii/ 

https://www.geeksforgeeks.org/given-an-array-of-of-size-n-finds-all-the-elements-that-appear-more-than-nk-times/ 

  1. Merge overlapping intervals

https://leetcode.com/problems/merge-intervals/ 

  1. Rotate matrix

https://leetcode.com/problems/rotate-image/ 

  1. Buy / Sell stocks - I, II, III: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/

  1. String

    1. Pattern matching algorithms (KMP + Rabin Karp)

https://www.geeksforgeeks.org/kmp-algorithm-for-pattern-searching/ 

https://www.geeksforgeeks.org/rabin-karp-algorithm-for-pattern-searching/ 

  1. Using StringBuilder class -> Add, Multiply Strings

https://www.geeksforgeeks.org/stringbuilder-class-in-java-with-examples/

https://www.geeksforgeeks.org/stringbuilder-append-method-in-java-with-examples/ 


  1. String compression algorithm

https://leetcode.com/problems/string-compression/ 



  1. LinkedList

    1. Implementation of Linkedlist

https://www.geeksforgeeks.org/implementing-a-linked-list-in-java-using-class/ 

https://leetcode.com/problems/design-linked-list/ 

  1. Detect cycle in a linkedlist - Floyd Algo

https://leetcode.com/problems/linked-list-cycle/ 

  1. Reverse a linked list + reverse in groups

https://leetcode.com/problems/reverse-linked-list/ 

https://leetcode.com/problems/reverse-nodes-in-k-group/ 

  1. Stack

    1. Implementation of Stack

https://www.geeksforgeeks.org/stack-data-structure-introduction-program/

https://www.geeksforgeeks.org/stack-class-in-java/ 

  1. Balance parenthesis

https://leetcode.com/problems/valid-parentheses/

  1. Trapping rain water

https://leetcode.com/problems/trapping-rain-water/ 

  1. Implement min stack

https://leetcode.com/problems/min-stack/ 







  1. Queue

    1. Implementation of Queue + Deque

https://www.geeksforgeeks.org/queue-set-1introduction-and-array-implementation/

https://www.geeksforgeeks.org/queue-interface-java/ 

https://www.geeksforgeeks.org/implementation-deque-using-circular-array/

https://www.geeksforgeeks.org/deque-interface-java-example/


  1. Sliding window maximum

https://leetcode.com/problems/sliding-window-maximum/ 

  1. Implement BFS 

https://www.geeksforgeeks.org/breadth-first-search-or-bfs-for-a-graph/ 

  1. Implement Level order in Binary tree

https://leetcode.com/problems/binary-tree-level-order-traversal/ 


  1. PriorityQueue or Heap

    1. Implementation of Heap Data structure

https://www.geeksforgeeks.org/heap-data-structure/ 

  1. Connect n ropes with min cost: https://www.geeksforgeeks.org/connect-n-ropes-minimum-cost/

  2. Median of running stream: https://www.geeksforgeeks.org/median-of-stream-of-running-integers-using-stl/

  3. LRU and LFU cache

https://leetcode.com/problems/lru-cache/ 

https://leetcode.com/problems/lfu-cache/ 




  1. Set & Map

    1. Internal working of HashMap

https://www.geeksforgeeks.org/internal-working-of-hashmap-java/ 

  1. 4-sum

https://leetcode.com/problems/4sum/ 

  1. Longest substring without repeat: https://www.interviewbit.com/problems/longest-substring-without-repeat/

  1. Binary Tree

    1. Implementation: insert, delete, traverse: https://youtu.be/QhIM-G7FAow

    2. Print top view, left view, right view, bottom view, level order, zig-zag traversal of Binary tree

https://www.geeksforgeeks.org/print-nodes-top-view-binary-tree/ 

https://www.geeksforgeeks.org/print-left-view-binary-tree/   

https://leetcode.com/problems/binary-tree-right-side-view/ 

https://www.geeksforgeeks.org/bottom-view-binary-tree/ 

https://www.geeksforgeeks.org/level-order-tree-traversal/

https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ 

  1. Invert a binary tree: https://leetcode.com/problems/invert-binary-tree/

  2. Lowest common ancestor

https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ 


  1. Binary Search Tree

    1. Implementation

https://www.geeksforgeeks.org/binary-search-tree-set-1-search-and-insertion/ 


  1. Check if a tree is BST or not

https://www.geeksforgeeks.org/a-program-to-check-if-a-binary-tree-is-bst-or-not/ 

  1. AVL tree and rotation

https://www.geeksforgeeks.org/avl-tree-set-1-insertion/ 

https://www.geeksforgeeks.org/avl-tree-set-2-deletion/ 


  1. Graph

    1. Implementation, BFS and DFS traversals

https://www.geeksforgeeks.org/graph-and-its-representations/ 

https://www.geeksforgeeks.org/breadth-first-search-or-bfs-for-a-graph/ 

https://www.geeksforgeeks.org/depth-first-search-or-dfs-for-a-graph/ 

  1. Topological sorting

https://www.geeksforgeeks.org/topological-sorting/ 

  1. Bellman ford Algorithm

https://www.geeksforgeeks.org/bellman-ford-algorithm-dp-23/ 

  1. Dijkstra's Algorithm

https://www.geeksforgeeks.org/dijkstras-shortest-path-algorithm-greedy-algo-7/ 

  1. Prim's Algorithm

https://www.geeksforgeeks.org/prims-minimum-spanning-tree-mst-greedy-algo-5/ 

  1. Kruskal's Algorithm

https://www.geeksforgeeks.org/kruskals-minimum-spanning-tree-algorithm-greedy-algo-2/ 

  1. Unique Islands Problem: https://www.geeksforgeeks.org/find-the-number-of-distinct-islands-in-a-2d-matrix/


  1. Trie

    1. Implementation

https://www.geeksforgeeks.org/trie-insert-and-search/ 

  1. Segment Trees : More important in CP

    1. Implementation

https://www.hackerearth.com/practice/data-structures/advanced-data-structures/segment-trees/tutorial/



Algorithms:


  1. Two pointers Algorithm

    1. 3-Sum

https://leetcode.com/problems/3sum/ 

  1. Container with most water

https://leetcode.com/problems/container-with-most-water/ 

  1. Sort the array containing only 0, 1 and 2

https://www.geeksforgeeks.org/sort-an-array-of-0s-1s-and-2s/ 

  1. Math

    1. Fast Power: https://www.youtube.com/watch?v=dyrRM8dTEus

    2. Euclid GCD: https://www.geeksforgeeks.org/euclidean-algorithms-basic-and-extended/ 

    3. Sieve of Eratosthenes:

https://www.geeksforgeeks.org/sieve-of-eratosthenes/ 

  1. Recursion + Backtracking

    1. Sudoku solver

https://leetcode.com/problems/sudoku-solver/ 

  1. N-Queens Problem

https://leetcode.com/problems/n-queens/ 

  1. Permutation and Combinations (Bruteforce)

https://www.geeksforgeeks.org/permutation-and-combination/ 

  1. Bits Manipulation + Mathematics

    1. Find one  non-repeating number, find two

https://www.geeksforgeeks.org/non-repeating-element/ 

https://www.geeksforgeeks.org/find-two-non-repeating-elements-in-an-array-of-repeating-elements/ 

  1. Count 1 bits in a number

https://leetcode.com/problems/number-of-1-bits/ 

  1. Divide & Conquer

    1. Merge Sort

https://www.geeksforgeeks.org/merge-sort/ 

  1. Median of two sorted arrays

https://leetcode.com/problems/median-of-two-sorted-arrays/ 


  1. Binary Searching

    1. Find upper and lower bound using Binary search

https://www.geeksforgeeks.org/find-first-and-last-positions-of-an-element-in-a-sorted-array/ 

  1. Allocate books: https://www.interviewbit.com/problems/allocate-books/

  1. Greedy Programming

    1. Candy distribution: https://www.interviewbit.com/problems/distribute-candy/

    2. Gas station: https://www.interviewbit.com/problems/gas-station/

    3. Fractional Knapsack

https://www.geeksforgeeks.org/fractional-knapsack-problem/ 

  1. Dynamic Programming

    1. 0/1 Knapsack: https://www.youtube.com/watch?v=y6kpGJBI7t0

    2. Longest increasing subsequence

https://leetcode.com/problems/longest-increasing-subsequence/ 

  1. Matrix chain multiplication

https://www.geeksforgeeks.org/matrix-chain-multiplication-dp-8/ 

  1. Coin change problem

https://leetcode.com/problems/coin-change/ 



Operating System:

  1. Basics of Threads

  2. Process scheduling algorithms

  3. Critical section Problem

  4. Deadlock

  5. Memory management

    1. Paging

    2. Segmentation

  6. Page replacement algorithms

  7. Disk scheduling algorithms



DBMS:

  1. Types of Keys: Candidate, Super, Foriengn keys

  2. Normal Forms

  3. Joins

  4. SQL queries

  5. ACID properties

  6. Indexing: B trees, B+ trees concepts


System design:


  1. Low level design

    1. Class, ER diagrams

    2. OOPS concepts

    3. Design Elevator system, Parking Lot, MakeMyTrip System

  2. High level design

    1. Scaling

    2. Distributed systems

    3. Microservice and Monolithic architecture

    4. Load balancing

    5. Message queue

    6. Design Whatsapp, Tinder, Uber system


Linking Words/ Conjunctions

  Linking Words/ Conjunctions Conjunctions are words that link other words, phrases, or clauses together. Kinds of conjunctions Conjunctions...