Data Structures
Data Structure Tree & Graph
important questions and answers (learn complete syllabus below questions are just to tell you learn them in detailed )
Learn
Algorithms for all techniques
- ·
Binary
Search
- ·
Bubble
Sort
- ·
Insertion
sort
- ·
Selection
Sort
- · Operations on Linked Lists – create, insert, delete, search,
- · evaluation of Postfix expressions
- · Graph Traversal (BFS and DFS)
- · Finding Shortest Path - Warshall's Algorithm
1. time-space tradeoff:- (Ans :-A time-space tradeoff means that in programming, you can often make a program run faster by using more memory, or save memory by making it slower.
Example:
If you store answers in a list or dictionary, the program finds them quickly (less time) but uses extra memory (more space). If you don’t store them, the program recalculates every time, which saves memory but takes more time.)
Big-O notation:-
Common types:
O(1) – Constant Time: Execution time stays the same no matter how much data there is.
Example: accessing an element by index in an array.O(n) – Linear Time: Time grows directly with the input size.
Example: searching for a number in a list one by one.O(n²) – Quadratic Time: Time grows very fast because of nested loops.
Example: comparing every student with every other student in a class.
Big-O helps programmers choose better algorithms by comparing which one is faster or uses less memory for large inputs.
2. String operations:- A string is a sequence of characters used to store text in programming.
It can contain letters, numbers, symbols, and spaces, and is usually written inside quotation marks.
Examples:
"Hello""12345""Good Morning"
In most programming languages:
A single character is called a character.
Multiple characters together form a string.
Common string operations:
Concatenation: Joining two strings together.
Example:"Hello" + " World"→"Hello World"Length: Finding the number of characters in a string.
Example: length of"Apple"is5.Substring: Taking part of a string.
Example: from"Computer", substring(0,3)→"Com"Comparison: Checking if two strings are equal.
Example:"cat" == "cat"→ trueSearching: Finding a character or word inside a string.
Example: finding"pen"in"open".
String operations are widely used in tasks like text processing, searching, passwords, and user input handling.
- 3. Double link list
- 4. evaluation of Postfix expressions and infix to Postfix Evaluation, Recursion
- 5. Circular queues, Priority queues,
- 6. Binary Search Tree (create, delete, search, insert
- 7. Linked and static Representation of binary trees
- 8. graph representation using Adjacency matrix and adjacency lists
No comments:
Post a Comment